{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e502c9c3cb51",
   "metadata": {},
   "source": [
    "# Chapter 5: What the Model Becomes Inside an Agent\n",
    "\n",
    "The model chooses an action, but the tool determines what that action does. Changing the tool can therefore change the assembled agent while the chooser stays fixed. The same applies to memory, observations, and recurrence: the model is one factor in a stochastic system, not the whole system boundary.\n",
    "\n",
    "This notebook composes a small chooser matrix with a tool matrix and follows the resulting state distribution over repeated transitions. Beside that kernel experiment, it compares two reliability constructions with identical marginal step success. One has independent step outcomes; the other has a single shared good-or-bad condition. Their disagreement makes a practical point: multiplying average step rates is not justified merely because the averages look reassuring.\n",
    "\n",
    "**Outcome:** Compose a chooser and tool kernel, then separate marginal from trajectory reliability.\n",
    "\n",
    "- Inspect the declared input contract\n",
    "- Predict the hand-checkable case\n",
    "- Run the shared computation\n",
    "- Change the critical assumption\n",
    "- Apply the method to the transfer data\n",
    "\n",
    "**Guided route:** Run the worked calculation, inspect its figure, change the stated assumption, and try the transfer case. Read the explanations beside each result before opening the answers.\n",
    "\n",
    "**Deeper route:** First read the mathematics and canonical equation reference. Audit the input contract, predict the changed result, then inspect the shared chapter implementation and solve the questions independently. Both routes use the same calculations and preserve the equations."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a7781f3ee7dc",
   "metadata": {},
   "source": [
    "## Technical Requirements\n",
    "\n",
    "Python 3.11 or later, the complete laboratory folder, and the notebook dependencies listed in `requirements-notebooks.txt` (the launcher's **Install notebook tools** choice installs them; see START-HERE). Standard-library chapter commands also support Python 3.10. No API key, model account or network call is used by this experiment.\n",
    "\n",
    "Prior knowledge:\n",
    "\n",
    "- Python lists and dictionaries\n",
    "- The mapped chapter and its notation"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6617e700ffff",
   "metadata": {},
   "source": [
    "## The question and its mathematics\n",
    "\n",
    "Let C(i,a) be the chooser probability of action a in state i, and T(a,j) the tool probability of next state j after that action. The composed kernel is K(i,j)=sum_a C(i,a)T(a,j). Its rows sum to one when both factors are normalized. A row-vector state distribution evolves as mu_(t+1)=mu_t K.\n",
    "\n",
    "This finite factorization deliberately omits state-dependent tool effects beyond the declared action encoding. To model them, enlarge the state/action representation rather than silently crediting the chooser with tool behavior. The changed tool kernel leaves C fixed, so any distributional difference is attributable to that controlled factor change inside this construction.\n",
    "\n",
    "For reliability, independent equal-probability steps give P(all n succeed)=p^n. A shared condition that makes every step succeed together with probability p gives P(all n succeed)=p. Both have marginal step success p. The general chain rule is the product of conditional probabilities P(S_t|S_1,...,S_(t-1)); supplied marginals are not those conditionals.\n",
    "\n",
    "The conditional_success vector is therefore a separate input. Its product describes its own declared trajectory law and need not have the same length or dependence structure as the plotted equal-step cases. None of these constructed distributions predicts a real agent without corresponding evidence.\n",
    "\n",
    "The assembly comparison makes the remaining system factors explicit. O maps state to observed context; M maps observed context through the declared memory transform; R applies the retrieval transform; C is the same frozen chooser; T supplies the tool effect. The assembly kernel is O M R C T. Every row-stochastic product remains row stochastic. These finite maps are a construction, not a representation learned from documents. The state and context encoding must contain whatever history matters for the intended Markov boundary."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e7b4afca7e8b",
   "metadata": {},
   "source": [
    "## A calculation you can run\n",
    "\n",
    "Supply normalized chooser rows, normalized tool rows, and an initial state distribution. The chooser's action dimension must match the tool's row count, and the tool's next-state dimension must match the chooser's state count. The function multiplies the factors, then propagates the initial distribution for the declared number of steps.\n",
    "\n",
    "The state-zero occupancy chart shows recurrence under the composite kernel. The two reliability charts use transition count on the horizontal axis and all-step success probability on the vertical axis. They are separate constructions, not estimates from the occupancy curve. Change the tool matrix while keeping the chooser fixed, then compare terminal state distributions. Use the explicit conditional vector to check the chain rule independently by hand.\n",
    "\n",
    "Compare five assemblies: complete context, blurred memory, blurred retrieval, blurred observation, and a single-transition controller. Their declared resource allowances match in the default case. A blurred map sends either context to the same equal mixture, erasing its distinction before the fixed chooser acts. The recurrence comparison changes transition count while reserving the same allowance; it does not claim equal consumed work. Read assembly_budgets_matched and assembly_depths_matched before attributing an observed difference to one factor. The transfer case deliberately breaks budget equality.\n",
    "\n",
    "The next cell finds the bundle and imports the same computation used by the chapter skill. It does not change your system Python."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "42ebefc0e5c1",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path\n",
    "import sys, json\n",
    "LAB_ROOT = next((p for p in [Path.cwd(), *Path.cwd().parents] if (p / \"lab-manifest.json\").is_file()), None)\n",
    "if LAB_ROOT is None:\n",
    "    raise RuntimeError(\"Open this notebook from the complete extracted laboratory folder.\")\n",
    "sys.path.insert(0, str(LAB_ROOT / \"src\"))\n",
    "from math_ai_agents.core import analyze, report_text\n",
    "from math_ai_agents.plotting import figure_svg\n",
    "from IPython.display import SVG, display\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7fffde8c0edb",
   "metadata": {},
   "source": [
    "Set the declared inputs below. These are constructed teaching values, not measurements from a production agent. Change a value only after predicting what it should change."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "fcb16d16c15c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Chapter 5: composite-kernel\n",
      "What system does a frozen chooser become when its surrounding kernel changes?\n",
      "Evidence: constructed teaching example\n",
      "\n",
      "Calculated quantities:\n",
      "{\n",
      "  \"assemblies\": [\n",
      "    {\n",
      "      \"assembly\": \"complete\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.76,\n",
      "          0.24\n",
      "        ],\n",
      "        [\n",
      "          0.41,\n",
      "          0.59\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.6307794162,\n",
      "        0.3692205838\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"memory blurred\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.585,\n",
      "          0.415\n",
      "        ],\n",
      "        [\n",
      "          0.585,\n",
      "          0.415\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.585,\n",
      "        0.415\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"retrieval blurred\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.585,\n",
      "          0.415\n",
      "        ],\n",
      "        [\n",
      "          0.585,\n",
      "          0.415\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.585,\n",
      "        0.415\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"observation blurred\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.585,\n",
      "          0.415\n",
      "        ],\n",
      "        [\n",
      "          0.585,\n",
      "          0.415\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.585,\n",
      "        0.415\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"single transition\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 1,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.76,\n",
      "          0.24\n",
      "        ],\n",
      "        [\n",
      "          0.41,\n",
      "          0.59\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.76,\n",
      "        0.24\n",
      "      ]\n",
      "    }\n",
      "  ],\n",
      "  \"assembly_budgets_matched\": true,\n",
      "  \"assembly_depths_matched\": false,\n",
      "  \"composite_kernel\": [\n",
      "    [\n",
      "      0.76,\n",
      "      0.24\n",
      "    ],\n",
      "    [\n",
      "      0.41,\n",
      "      0.59\n",
      "    ]\n",
      "  ],\n",
      "  \"terminal_distribution\": [\n",
      "    0.6307692308,\n",
      "    0.3692307692\n",
      "  ],\n",
      "  \"independent_all_success\": 0.3660323413,\n",
      "  \"shared_condition_all_success\": 0.99,\n",
      "  \"chain_rule_all_success\": 0.3660323413\n",
      "}\n",
      "\n",
      "Interpretation:\n",
      "The frozen chooser and tool jointly define the state kernel. Equal marginal step success can coexist with sharply different trajectory reliability.\n",
      "\n",
      "Assumptions:\n",
      "- Kernel factors use the declared state and action boundary.\n",
      "- Independent and shared-condition cases are different constructed joint distributions.\n",
      "- Chain-rule inputs condition each success on previous successes.\n",
      "\n",
      "Limitations:\n",
      "- Marginal rates cannot be inserted into the conditional chain rule without justification.\n",
      "- No measured agent reliability is inferred from these constructions.\n",
      "- Observation, memory and retrieval maps are declared finite context transformations; they do not measure a real memory implementation.\n",
      "- Resource allowance equality is necessary for a matched ablation, not evidence of equal consumed work.\n",
      "\n",
      "Execution: completed locally; constructed inputs are not deployment measurements.\n"
     ]
    }
   ],
   "source": [
    "chapter = 5\n",
    "inputs = {'step_success': 0.99,\n",
    " 'steps': 100,\n",
    " 'conditional_success': [0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99],\n",
    " 'chooser': [[0.8, 0.2], [0.3, 0.7]],\n",
    " 'tool': [[0.9, 0.1], [0.2, 0.8]],\n",
    " 'initial': [1, 0],\n",
    " 'assemblies': [{'name': 'complete',\n",
    "                 'budget': 100,\n",
    "                 'steps': 10,\n",
    "                 'observation': [[1, 0], [0, 1]],\n",
    "                 'memory': [[1, 0], [0, 1]],\n",
    "                 'retrieval': [[1, 0], [0, 1]],\n",
    "                 'tool': [[0.9, 0.1], [0.2, 0.8]]},\n",
    "                {'name': 'memory blurred',\n",
    "                 'budget': 100,\n",
    "                 'steps': 10,\n",
    "                 'observation': [[1, 0], [0, 1]],\n",
    "                 'memory': [[0.5, 0.5], [0.5, 0.5]],\n",
    "                 'retrieval': [[1, 0], [0, 1]],\n",
    "                 'tool': [[0.9, 0.1], [0.2, 0.8]]},\n",
    "                {'name': 'retrieval blurred',\n",
    "                 'budget': 100,\n",
    "                 'steps': 10,\n",
    "                 'observation': [[1, 0], [0, 1]],\n",
    "                 'memory': [[1, 0], [0, 1]],\n",
    "                 'retrieval': [[0.5, 0.5], [0.5, 0.5]],\n",
    "                 'tool': [[0.9, 0.1], [0.2, 0.8]]},\n",
    "                {'name': 'observation blurred',\n",
    "                 'budget': 100,\n",
    "                 'steps': 10,\n",
    "                 'observation': [[0.5, 0.5], [0.5, 0.5]],\n",
    "                 'memory': [[1, 0], [0, 1]],\n",
    "                 'retrieval': [[1, 0], [0, 1]],\n",
    "                 'tool': [[0.9, 0.1], [0.2, 0.8]]},\n",
    "                {'name': 'single transition',\n",
    "                 'budget': 100,\n",
    "                 'steps': 1,\n",
    "                 'observation': [[1, 0], [0, 1]],\n",
    "                 'memory': [[1, 0], [0, 1]],\n",
    "                 'retrieval': [[1, 0], [0, 1]],\n",
    "                 'tool': [[0.9, 0.1], [0.2, 0.8]]}]}\n",
    "report = analyze(chapter, inputs)\n",
    "# This input was explicitly taken from the teaching fixture.\n",
    "report['evidence_kind'] = 'constructed teaching example'\n",
    "print(report_text(report))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9d1a7eaf9557",
   "metadata": {},
   "source": [
    "With p=0.99 and n=100, independent all-step success is about 0.366. Under the shared condition, all-step success is 0.99. The per-step marginals are identical. That contrast rules out treating a marginal success rate as enough information to determine long-run completion.\n",
    "\n",
    "The default composed first row is [0.76,0.24]: action-zero contribution is 0.8 times [0.9,0.1], and action-one contribution is 0.2 times [0.2,0.8]. In the changed case this row becomes [0.50,0.50] because only the tool factor changes. The frozen chooser now participates in a different recurrent system, even though its own probabilities are unchanged.\n",
    "\n",
    "The plot below uses the calculated quantities. Read each panel's units before comparing its values."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "590f57e74048",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Matplotlib is building the font cache; this may take a moment.\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\" width=\"576pt\" height=\"835.2pt\" viewBox=\"0 0 576 835.2\" version=\"1.1\"><title>Calculated chapter experiment</title><desc>Labeled plot of the explicitly supplied chapter inputs. See the adjacent explanation for assumptions.</desc>\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Mathematics of AI Agents Laboratory</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 835.2  L 576 835.2  L 576 0  L 0 0  z \" style=\"fill: #ffffff\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 60.922344 223.379766  L 565.2 223.379766  L 565.2 89.960234  L 60.922344 89.960234  z \" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path id=\"md4f6ae6131\" d=\"M 0 0  L 0 3.5  \" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"83.844055\" y=\"223.379766\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"83.844055\" y=\"237.977422\" transform=\"rotate(-0 83.844055 237.977422)\">0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"175.530902\" y=\"223.379766\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"175.530902\" y=\"237.977422\" transform=\"rotate(-0 175.530902 237.977422)\">20</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"267.217749\" y=\"223.379766\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"267.217749\" y=\"237.977422\" transform=\"rotate(-0 267.217749 237.977422)\">40</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"358.904595\" y=\"223.379766\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"358.904595\" y=\"237.977422\" transform=\"rotate(-0 358.904595 237.977422)\">60</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"450.591442\" y=\"223.379766\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"450.591442\" y=\"237.977422\" transform=\"rotate(-0 450.591442 237.977422)\">80</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"542.278288\" y=\"223.379766\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"542.278288\" y=\"237.977422\" transform=\"rotate(-0 542.278288 237.977422)\">100</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_7\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"313.061172\" y=\"251.977422\" transform=\"rotate(-0 313.061172 251.977422)\">step count</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path d=\"M 60.922344 210.81656  L 565.2 210.81656  \" clip-path=\"url(#p38eb2ed676)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\">\n",
       "      <defs>\n",
       "       <path id=\"mdb83a66956\" d=\"M 0 0  L -3.5 0  \" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"210.81656\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"214.615388\" transform=\"rotate(-0 53.922344 214.615388)\">0.4</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path d=\"M 60.922344 172.552626  L 565.2 172.552626  \" clip-path=\"url(#p38eb2ed676)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"172.552626\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"176.351454\" transform=\"rotate(-0 53.922344 176.351454)\">0.6</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path d=\"M 60.922344 134.288692  L 565.2 134.288692  \" clip-path=\"url(#p38eb2ed676)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"134.288692\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"138.087521\" transform=\"rotate(-0 53.922344 138.087521)\">0.8</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path d=\"M 60.922344 96.024759  L 565.2 96.024759  \" clip-path=\"url(#p38eb2ed676)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"96.024759\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"99.823587\" transform=\"rotate(-0 53.922344 99.823587)\">1.0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_12\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"31.616875\" y=\"156.67\" transform=\"rotate(-90 31.616875 156.67)\">completion probability</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_15\">\n",
       "    <path d=\"M 83.844055 96.024759  L 88.428398 97.937955  L 93.01274 99.83202  L 97.597082 101.707144  L 102.181425 103.563517  L 106.765767 105.401326  L 111.350109 107.220757  L 115.934452 109.021994  L 120.518794 110.805218  L 125.103136 112.57061  L 129.687479 114.318348  L 134.271821 116.048609  L 138.856163 117.761567  L 143.440506 119.457396  L 148.024848 121.136266  L 152.60919 122.798348  L 157.193533 124.443809  L 161.777875 126.072815  L 166.362217 127.685531  L 170.94656 129.28212  L 175.530902 130.862743  L 180.115244 132.42756  L 184.699587 133.976729  L 189.283929 135.510406  L 193.868271 137.028746  L 198.452614 138.531903  L 203.036956 140.020028  L 207.621298 141.493272  L 212.205641 142.951783  L 216.789983 144.39571  L 221.374325 145.825197  L 225.958668 147.240389  L 230.54301 148.64143  L 235.127352 150.02846  L 239.711695 151.401619  L 244.296037 152.761048  L 248.880379 154.106881  L 253.464722 155.439257  L 258.049064 156.758308  L 262.633406 158.06417  L 267.217749 159.356972  L 271.802091 160.636847  L 276.386433 161.903923  L 280.970776 163.158328  L 285.555118 164.400189  L 290.13946 165.629631  L 294.723803 166.846779  L 299.308145 168.051756  L 303.892487 169.244682  L 308.47683 170.42568  L 313.061172 171.594867  L 317.645514 172.752363  L 322.229857 173.898283  L 326.814199 175.032745  L 331.398541 176.155862  L 335.982884 177.267747  L 340.567226 178.368514  L 345.151568 179.458273  L 349.735911 180.537135  L 354.320253 181.605208  L 358.904595 182.6626  L 363.488937 183.709418  L 368.07328 184.745768  L 372.657622 185.771755  L 377.241964 186.787482  L 381.826307 187.793051  L 386.410649 188.788565  L 390.994991 189.774124  L 395.579334 190.749827  L 400.163676 191.715773  L 404.748018 192.672059  L 409.332361 193.618783  L 413.916703 194.556039  L 418.501045 195.483923  L 423.085388 196.402528  L 427.66973 197.311947  L 432.254072 198.212272  L 436.838415 199.103594  L 441.422757 199.986002  L 446.007099 200.859586  L 450.591442 201.724435  L 455.175784 202.580635  L 459.760126 203.428273  L 464.344469 204.267434  L 468.928811 205.098204  L 473.513153 205.920666  L 478.097496 206.734904  L 482.681838 207.540999  L 487.26618 208.339033  L 491.850523 209.129087  L 496.434865 209.911241  L 501.019207 210.685573  L 505.60355 211.452161  L 510.187892 212.211084  L 514.772234 212.962417  L 519.356577 213.706237  L 523.940919 214.442619  L 528.525261 215.171637  L 533.109604 215.893365  L 537.693946 216.607876  L 542.278288 217.315241  \" clip-path=\"url(#p38eb2ed676)\" style=\"fill: none; stroke: #31586b; stroke-width: 1.8; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 60.922344 223.379766  L 60.922344 89.960234  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 60.922344 223.379766  L 565.2 223.379766  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"text_13\">\n",
       "    <text style=\"font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: start\" x=\"60.922344\" y=\"83.960234\" transform=\"rotate(-0 60.922344 83.960234)\">independent trajectory success</text>\n",
       "   </g>\n",
       "  </g>\n",
       "  <g id=\"axes_2\">\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 60.922344 413.279062  L 565.2 413.279062  L 565.2 279.859531  L 60.922344 279.859531  z \" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_3\">\n",
       "    <g id=\"xtick_7\">\n",
       "     <g id=\"line2d_16\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"83.844055\" y=\"413.279062\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_14\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"83.844055\" y=\"427.876719\" transform=\"rotate(-0 83.844055 427.876719)\">0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_8\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"175.530902\" y=\"413.279062\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_15\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"175.530902\" y=\"427.876719\" transform=\"rotate(-0 175.530902 427.876719)\">20</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_9\">\n",
       "     <g id=\"line2d_18\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"267.217749\" y=\"413.279062\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_16\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"267.217749\" y=\"427.876719\" transform=\"rotate(-0 267.217749 427.876719)\">40</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_10\">\n",
       "     <g id=\"line2d_19\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"358.904595\" y=\"413.279062\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_17\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"358.904595\" y=\"427.876719\" transform=\"rotate(-0 358.904595 427.876719)\">60</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_11\">\n",
       "     <g id=\"line2d_20\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"450.591442\" y=\"413.279062\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_18\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"450.591442\" y=\"427.876719\" transform=\"rotate(-0 450.591442 427.876719)\">80</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_12\">\n",
       "     <g id=\"line2d_21\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"542.278288\" y=\"413.279062\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_19\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"542.278288\" y=\"427.876719\" transform=\"rotate(-0 542.278288 427.876719)\">100</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_20\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"313.061172\" y=\"441.876719\" transform=\"rotate(-0 313.061172 441.876719)\">step count</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_4\">\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_22\">\n",
       "      <path d=\"M 60.922344 407.214538  L 565.2 407.214538  \" clip-path=\"url(#p186f3bcba1)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_23\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"407.214538\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_21\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"411.013366\" transform=\"rotate(-0 53.922344 411.013366)\">0.990</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_24\">\n",
       "      <path d=\"M 60.922344 382.956442  L 565.2 382.956442  \" clip-path=\"url(#p186f3bcba1)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_25\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"382.956442\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_22\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"386.75527\" transform=\"rotate(-0 53.922344 386.75527)\">0.992</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_26\">\n",
       "      <path d=\"M 60.922344 358.698345  L 565.2 358.698345  \" clip-path=\"url(#p186f3bcba1)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_27\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"358.698345\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_23\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"362.497173\" transform=\"rotate(-0 53.922344 362.497173)\">0.994</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_8\">\n",
       "     <g id=\"line2d_28\">\n",
       "      <path d=\"M 60.922344 334.440249  L 565.2 334.440249  \" clip-path=\"url(#p186f3bcba1)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_29\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"334.440249\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_24\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"338.239077\" transform=\"rotate(-0 53.922344 338.239077)\">0.996</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_9\">\n",
       "     <g id=\"line2d_30\">\n",
       "      <path d=\"M 60.922344 310.182152  L 565.2 310.182152  \" clip-path=\"url(#p186f3bcba1)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_31\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"310.182152\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_25\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"313.98098\" transform=\"rotate(-0 53.922344 313.98098)\">0.998</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_10\">\n",
       "     <g id=\"line2d_32\">\n",
       "      <path d=\"M 60.922344 285.924055  L 565.2 285.924055  \" clip-path=\"url(#p186f3bcba1)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_33\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"285.924055\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_26\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"289.722884\" transform=\"rotate(-0 53.922344 289.722884)\">1.000</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_27\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"18.891875\" y=\"346.569297\" transform=\"rotate(-90 18.891875 346.569297)\">completion probability</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_34\">\n",
       "    <path d=\"M 83.844055 285.924055  L 88.428398 407.214538  L 93.01274 407.214538  L 97.597082 407.214538  L 102.181425 407.214538  L 106.765767 407.214538  L 111.350109 407.214538  L 115.934452 407.214538  L 120.518794 407.214538  L 125.103136 407.214538  L 129.687479 407.214538  L 134.271821 407.214538  L 138.856163 407.214538  L 143.440506 407.214538  L 148.024848 407.214538  L 152.60919 407.214538  L 157.193533 407.214538  L 161.777875 407.214538  L 166.362217 407.214538  L 170.94656 407.214538  L 175.530902 407.214538  L 180.115244 407.214538  L 184.699587 407.214538  L 189.283929 407.214538  L 193.868271 407.214538  L 198.452614 407.214538  L 203.036956 407.214538  L 207.621298 407.214538  L 212.205641 407.214538  L 216.789983 407.214538  L 221.374325 407.214538  L 225.958668 407.214538  L 230.54301 407.214538  L 235.127352 407.214538  L 239.711695 407.214538  L 244.296037 407.214538  L 248.880379 407.214538  L 253.464722 407.214538  L 258.049064 407.214538  L 262.633406 407.214538  L 267.217749 407.214538  L 271.802091 407.214538  L 276.386433 407.214538  L 280.970776 407.214538  L 285.555118 407.214538  L 290.13946 407.214538  L 294.723803 407.214538  L 299.308145 407.214538  L 303.892487 407.214538  L 308.47683 407.214538  L 313.061172 407.214538  L 317.645514 407.214538  L 322.229857 407.214538  L 326.814199 407.214538  L 331.398541 407.214538  L 335.982884 407.214538  L 340.567226 407.214538  L 345.151568 407.214538  L 349.735911 407.214538  L 354.320253 407.214538  L 358.904595 407.214538  L 363.488937 407.214538  L 368.07328 407.214538  L 372.657622 407.214538  L 377.241964 407.214538  L 381.826307 407.214538  L 386.410649 407.214538  L 390.994991 407.214538  L 395.579334 407.214538  L 400.163676 407.214538  L 404.748018 407.214538  L 409.332361 407.214538  L 413.916703 407.214538  L 418.501045 407.214538  L 423.085388 407.214538  L 427.66973 407.214538  L 432.254072 407.214538  L 436.838415 407.214538  L 441.422757 407.214538  L 446.007099 407.214538  L 450.591442 407.214538  L 455.175784 407.214538  L 459.760126 407.214538  L 464.344469 407.214538  L 468.928811 407.214538  L 473.513153 407.214538  L 478.097496 407.214538  L 482.681838 407.214538  L 487.26618 407.214538  L 491.850523 407.214538  L 496.434865 407.214538  L 501.019207 407.214538  L 505.60355 407.214538  L 510.187892 407.214538  L 514.772234 407.214538  L 519.356577 407.214538  L 523.940919 407.214538  L 528.525261 407.214538  L 533.109604 407.214538  L 537.693946 407.214538  L 542.278288 407.214538  \" clip-path=\"url(#p186f3bcba1)\" style=\"fill: none; stroke: #31586b; stroke-width: 1.8; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 60.922344 413.279062  L 60.922344 279.859531  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_7\">\n",
       "    <path d=\"M 60.922344 413.279062  L 565.2 413.279062  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"text_28\">\n",
       "    <text style=\"font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: start\" x=\"60.922344\" y=\"273.859531\" transform=\"rotate(-0 60.922344 273.859531)\">shared condition trajectory success</text>\n",
       "   </g>\n",
       "  </g>\n",
       "  <g id=\"axes_3\">\n",
       "   <g id=\"patch_8\">\n",
       "    <path d=\"M 60.922344 603.178359  L 565.2 603.178359  L 565.2 469.758828  L 60.922344 469.758828  z \" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_5\">\n",
       "    <g id=\"xtick_13\">\n",
       "     <g id=\"line2d_35\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"83.844055\" y=\"603.178359\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_29\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"83.844055\" y=\"617.776016\" transform=\"rotate(-0 83.844055 617.776016)\">0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_14\">\n",
       "     <g id=\"line2d_36\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"175.530902\" y=\"603.178359\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_30\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"175.530902\" y=\"617.776016\" transform=\"rotate(-0 175.530902 617.776016)\">20</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_15\">\n",
       "     <g id=\"line2d_37\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"267.217749\" y=\"603.178359\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_31\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"267.217749\" y=\"617.776016\" transform=\"rotate(-0 267.217749 617.776016)\">40</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_16\">\n",
       "     <g id=\"line2d_38\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"358.904595\" y=\"603.178359\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_32\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"358.904595\" y=\"617.776016\" transform=\"rotate(-0 358.904595 617.776016)\">60</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_17\">\n",
       "     <g id=\"line2d_39\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"450.591442\" y=\"603.178359\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_33\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"450.591442\" y=\"617.776016\" transform=\"rotate(-0 450.591442 617.776016)\">80</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_18\">\n",
       "     <g id=\"line2d_40\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"542.278288\" y=\"603.178359\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_34\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"542.278288\" y=\"617.776016\" transform=\"rotate(-0 542.278288 617.776016)\">100</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_35\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"313.061172\" y=\"631.776797\" transform=\"rotate(-0 313.061172 631.776797)\">transition count</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_6\">\n",
       "    <g id=\"ytick_11\">\n",
       "     <g id=\"line2d_41\">\n",
       "      <path d=\"M 60.922344 574.37187  L 565.2 574.37187  \" clip-path=\"url(#p417ef8cd5a)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_42\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"574.37187\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_36\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"578.170698\" transform=\"rotate(-0 53.922344 578.170698)\">0.7</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_12\">\n",
       "     <g id=\"line2d_43\">\n",
       "      <path d=\"M 60.922344 541.522364  L 565.2 541.522364  \" clip-path=\"url(#p417ef8cd5a)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_44\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"541.522364\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_37\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"545.321192\" transform=\"rotate(-0 53.922344 545.321192)\">0.8</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_13\">\n",
       "     <g id=\"line2d_45\">\n",
       "      <path d=\"M 60.922344 508.672858  L 565.2 508.672858  \" clip-path=\"url(#p417ef8cd5a)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_46\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"508.672858\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_38\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"512.471686\" transform=\"rotate(-0 53.922344 512.471686)\">0.9</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_14\">\n",
       "     <g id=\"line2d_47\">\n",
       "      <path d=\"M 60.922344 475.823352  L 565.2 475.823352  \" clip-path=\"url(#p417ef8cd5a)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_48\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"475.823352\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_39\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"479.62218\" transform=\"rotate(-0 53.922344 479.62218)\">1.0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_40\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"31.616875\" y=\"536.468594\" transform=\"rotate(-90 31.616875 536.468594)\">probability</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_49\">\n",
       "    <path d=\"M 83.844055 475.823352  L 88.428398 554.662166  L 93.01274 582.255751  L 97.597082 591.913506  L 102.181425 595.29372  L 106.765767 596.476795  L 111.350109 596.890871  L 115.934452 597.035798  L 120.518794 597.086522  L 125.103136 597.104276  L 129.687479 597.110489  L 134.271821 597.112664  L 138.856163 597.113425  L 143.440506 597.113692  L 148.024848 597.113785  L 152.60919 597.113818  L 157.193533 597.113829  L 161.777875 597.113833  L 166.362217 597.113834  L 170.94656 597.113835  L 175.530902 597.113835  L 180.115244 597.113835  L 184.699587 597.113835  L 189.283929 597.113835  L 193.868271 597.113835  L 198.452614 597.113835  L 203.036956 597.113835  L 207.621298 597.113835  L 212.205641 597.113835  L 216.789983 597.113835  L 221.374325 597.113835  L 225.958668 597.113835  L 230.54301 597.113835  L 235.127352 597.113835  L 239.711695 597.113835  L 244.296037 597.113835  L 248.880379 597.113835  L 253.464722 597.113835  L 258.049064 597.113835  L 262.633406 597.113835  L 267.217749 597.113835  L 271.802091 597.113835  L 276.386433 597.113835  L 280.970776 597.113835  L 285.555118 597.113835  L 290.13946 597.113835  L 294.723803 597.113835  L 299.308145 597.113835  L 303.892487 597.113835  L 308.47683 597.113835  L 313.061172 597.113835  L 317.645514 597.113835  L 322.229857 597.113835  L 326.814199 597.113835  L 331.398541 597.113835  L 335.982884 597.113835  L 340.567226 597.113835  L 345.151568 597.113835  L 349.735911 597.113835  L 354.320253 597.113835  L 358.904595 597.113835  L 363.488937 597.113835  L 368.07328 597.113835  L 372.657622 597.113835  L 377.241964 597.113835  L 381.826307 597.113835  L 386.410649 597.113835  L 390.994991 597.113835  L 395.579334 597.113835  L 400.163676 597.113835  L 404.748018 597.113835  L 409.332361 597.113835  L 413.916703 597.113835  L 418.501045 597.113835  L 423.085388 597.113835  L 427.66973 597.113835  L 432.254072 597.113835  L 436.838415 597.113835  L 441.422757 597.113835  L 446.007099 597.113835  L 450.591442 597.113835  L 455.175784 597.113835  L 459.760126 597.113835  L 464.344469 597.113835  L 468.928811 597.113835  L 473.513153 597.113835  L 478.097496 597.113835  L 482.681838 597.113835  L 487.26618 597.113835  L 491.850523 597.113835  L 496.434865 597.113835  L 501.019207 597.113835  L 505.60355 597.113835  L 510.187892 597.113835  L 514.772234 597.113835  L 519.356577 597.113835  L 523.940919 597.113835  L 528.525261 597.113835  L 533.109604 597.113835  L 537.693946 597.113835  L 542.278288 597.113835  \" clip-path=\"url(#p417ef8cd5a)\" style=\"fill: none; stroke: #31586b; stroke-width: 1.8; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_9\">\n",
       "    <path d=\"M 60.922344 603.178359  L 60.922344 469.758828  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_10\">\n",
       "    <path d=\"M 60.922344 603.178359  L 565.2 603.178359  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"text_41\">\n",
       "    <text style=\"font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: start\" x=\"60.922344\" y=\"463.758828\" transform=\"rotate(-0 60.922344 463.758828)\">state zero occupancy</text>\n",
       "   </g>\n",
       "  </g>\n",
       "  <g id=\"axes_4\">\n",
       "   <g id=\"patch_11\">\n",
       "    <path d=\"M 60.922344 793.077656  L 565.2 793.077656  L 565.2 659.658125  L 60.922344 659.658125  z \" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_7\">\n",
       "    <g id=\"xtick_19\">\n",
       "     <g id=\"line2d_50\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"83.844055\" y=\"793.077656\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_42\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"83.844055\" y=\"807.675313\" transform=\"rotate(-0 83.844055 807.675313)\">0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_20\">\n",
       "     <g id=\"line2d_51\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"198.452614\" y=\"793.077656\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_43\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"198.452614\" y=\"807.675313\" transform=\"rotate(-0 198.452614 807.675313)\">1</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_21\">\n",
       "     <g id=\"line2d_52\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"313.061172\" y=\"793.077656\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_44\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"313.061172\" y=\"807.675313\" transform=\"rotate(-0 313.061172 807.675313)\">2</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_22\">\n",
       "     <g id=\"line2d_53\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"427.66973\" y=\"793.077656\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_45\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"427.66973\" y=\"807.675313\" transform=\"rotate(-0 427.66973 807.675313)\">3</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_23\">\n",
       "     <g id=\"line2d_54\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md4f6ae6131\" x=\"542.278288\" y=\"793.077656\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_46\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"542.278288\" y=\"807.675313\" transform=\"rotate(-0 542.278288 807.675313)\">4</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_47\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"313.061172\" y=\"821.676094\" transform=\"rotate(-0 313.061172 821.676094)\">assembly index (see table)</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_8\">\n",
       "    <g id=\"ytick_15\">\n",
       "     <g id=\"line2d_55\">\n",
       "      <path d=\"M 60.922344 776.616805  L 565.2 776.616805  \" clip-path=\"url(#p2cd1a9d675)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_56\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"776.616805\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_48\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"780.415633\" transform=\"rotate(-0 53.922344 780.415633)\">0.60</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_16\">\n",
       "     <g id=\"line2d_57\">\n",
       "      <path d=\"M 60.922344 741.962381  L 565.2 741.962381  \" clip-path=\"url(#p2cd1a9d675)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_58\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"741.962381\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_49\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"745.761209\" transform=\"rotate(-0 53.922344 745.761209)\">0.65</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_17\">\n",
       "     <g id=\"line2d_59\">\n",
       "      <path d=\"M 60.922344 707.307958  L 565.2 707.307958  \" clip-path=\"url(#p2cd1a9d675)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_60\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"707.307958\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_50\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"711.106786\" transform=\"rotate(-0 53.922344 711.106786)\">0.70</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_18\">\n",
       "     <g id=\"line2d_61\">\n",
       "      <path d=\"M 60.922344 672.653534  L 565.2 672.653534  \" clip-path=\"url(#p2cd1a9d675)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_62\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mdb83a66956\" x=\"60.922344\" y=\"672.653534\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_51\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"676.452362\" transform=\"rotate(-0 53.922344 676.452362)\">0.75</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_52\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"25.254375\" y=\"726.367891\" transform=\"rotate(-90 25.254375 726.367891)\">probability</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_63\">\n",
       "    <path d=\"M 83.844055 755.283946  L 198.452614 787.013132  L 313.061172 787.013132  L 427.66973 787.013132  L 542.278288 665.722649  \" clip-path=\"url(#p2cd1a9d675)\" style=\"fill: none; stroke: #31586b; stroke-width: 1.8; stroke-linecap: square\"/>\n",
       "    <defs>\n",
       "     <path id=\"ma15aff9cb8\" d=\"M 0 2  C 0.530406 2 1.03916 1.789267 1.414214 1.414214  C 1.789267 1.03916 2 0.530406 2 0  C 2 -0.530406 1.789267 -1.03916 1.414214 -1.414214  C 1.03916 -1.789267 0.530406 -2 0 -2  C -0.530406 -2 -1.03916 -1.789267 -1.414214 -1.414214  C -1.789267 -1.03916 -2 -0.530406 -2 0  C -2 0.530406 -1.789267 1.03916 -1.414214 1.414214  C -1.03916 1.789267 -0.530406 2 0 2  z \" style=\"stroke: #31586b\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p2cd1a9d675)\">\n",
       "     <use xlink:href=\"#ma15aff9cb8\" x=\"83.844055\" y=\"755.283946\" style=\"fill: #31586b; stroke: #31586b\"/>\n",
       "     <use xlink:href=\"#ma15aff9cb8\" x=\"198.452614\" y=\"787.013132\" style=\"fill: #31586b; stroke: #31586b\"/>\n",
       "     <use xlink:href=\"#ma15aff9cb8\" x=\"313.061172\" y=\"787.013132\" style=\"fill: #31586b; stroke: #31586b\"/>\n",
       "     <use xlink:href=\"#ma15aff9cb8\" x=\"427.66973\" y=\"787.013132\" style=\"fill: #31586b; stroke: #31586b\"/>\n",
       "     <use xlink:href=\"#ma15aff9cb8\" x=\"542.278288\" y=\"665.722649\" style=\"fill: #31586b; stroke: #31586b\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_12\">\n",
       "    <path d=\"M 60.922344 793.077656  L 60.922344 659.658125  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_13\">\n",
       "    <path d=\"M 60.922344 793.077656  L 565.2 793.077656  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"text_53\">\n",
       "    <text style=\"font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: start\" x=\"60.922344\" y=\"653.658125\" transform=\"rotate(-0 60.922344 653.658125)\">assembled terminal state-zero probability</text>\n",
       "   </g>\n",
       "  </g>\n",
       "  <g id=\"text_54\">\n",
       "   <text style=\"font-size: 12px; font-family: 'DejaVu Sans'; text-anchor: start\" x=\"46.08\" y=\"25.822125\" transform=\"rotate(-0 46.08 25.822125)\">Chapter 5: composite kernel</text>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p38eb2ed676\">\n",
       "   <rect x=\"60.922344\" y=\"89.960234\" width=\"504.277656\" height=\"133.419531\"/>\n",
       "  </clipPath>\n",
       "  <clipPath id=\"p186f3bcba1\">\n",
       "   <rect x=\"60.922344\" y=\"279.859531\" width=\"504.277656\" height=\"133.419531\"/>\n",
       "  </clipPath>\n",
       "  <clipPath id=\"p417ef8cd5a\">\n",
       "   <rect x=\"60.922344\" y=\"469.758828\" width=\"504.277656\" height=\"133.419531\"/>\n",
       "  </clipPath>\n",
       "  <clipPath id=\"p2cd1a9d675\">\n",
       "   <rect x=\"60.922344\" y=\"659.658125\" width=\"504.277656\" height=\"133.419531\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(SVG(figure_svg(report)))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1dc9fbd68045",
   "metadata": {},
   "source": [
    "**Figure 5.L1:** Calculated chapter experiment. Each panel labels its input and output units; interpret it under the assumptions printed in the report."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "562db959210a",
   "metadata": {},
   "source": [
    "## Change the assumption\n",
    "\n",
    "A product of marginal rates can be exact in an independent construction and seriously wrong under shared failures. It can also be pessimistic when the workflow detects, retries, or recovers from errors. This notebook does not include recovery, so its all-step event should not be renamed authorized confirmed terminal completion.\n",
    "\n",
    "A composite kernel can also fail through a state boundary that omits information needed for the next transition. If memory version or tool state affects outcomes, but neither appears in the current state, the supplied kernel may not describe a Markov process. Adding more recurrence iterations will not repair that omission.\n",
    "\n",
    "The changed case is a controlled mechanism experiment, not a fitted explanation of empirical behavior. Real ablations need matched budgets, observations, and task populations. Preserve those conditions before claiming that one surrounding component accounts for measured agent improvement.\n",
    "\n",
    "The optional assembly table supplies observation, memory and retrieval ablations alongside recurrence. A changed terminal distribution identifies the consequence of the stipulated map within this construction. It does not show that a real memory or retrieval mechanism has the same effect. Different budgets or transition depths change the comparison contract and must be reported; the transfer table exposes a mismatched budget."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "1171b0cdfdb2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Chapter 5: composite-kernel\n",
      "What system does a frozen chooser become when its surrounding kernel changes?\n",
      "Evidence: constructed changed-assumption example\n",
      "\n",
      "Calculated quantities:\n",
      "{\n",
      "  \"assemblies\": [\n",
      "    {\n",
      "      \"assembly\": \"complete\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.5,\n",
      "          0.5\n",
      "        ],\n",
      "        [\n",
      "          0.25,\n",
      "          0.75\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.3333339691,\n",
      "        0.6666660309\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"memory blurred\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.375,\n",
      "          0.625\n",
      "        ],\n",
      "        [\n",
      "          0.375,\n",
      "          0.625\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.375,\n",
      "        0.625\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"retrieval blurred\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.375,\n",
      "          0.625\n",
      "        ],\n",
      "        [\n",
      "          0.375,\n",
      "          0.625\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.375,\n",
      "        0.625\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"observation blurred\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.375,\n",
      "          0.625\n",
      "        ],\n",
      "        [\n",
      "          0.375,\n",
      "          0.625\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.375,\n",
      "        0.625\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"single transition\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 1,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.5,\n",
      "          0.5\n",
      "        ],\n",
      "        [\n",
      "          0.25,\n",
      "          0.75\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.5,\n",
      "        0.5\n",
      "      ]\n",
      "    }\n",
      "  ],\n",
      "  \"assembly_budgets_matched\": true,\n",
      "  \"assembly_depths_matched\": false,\n",
      "  \"composite_kernel\": [\n",
      "    [\n",
      "      0.5,\n",
      "      0.5\n",
      "    ],\n",
      "    [\n",
      "      0.25,\n",
      "      0.75\n",
      "    ]\n",
      "  ],\n",
      "  \"terminal_distribution\": [\n",
      "    0.3333333333,\n",
      "    0.6666666667\n",
      "  ],\n",
      "  \"independent_all_success\": 0.3660323413,\n",
      "  \"shared_condition_all_success\": 0.99,\n",
      "  \"chain_rule_all_success\": 0.3660323413\n",
      "}\n",
      "\n",
      "Interpretation:\n",
      "The frozen chooser and tool jointly define the state kernel. Equal marginal step success can coexist with sharply different trajectory reliability.\n",
      "\n",
      "Assumptions:\n",
      "- Kernel factors use the declared state and action boundary.\n",
      "- Independent and shared-condition cases are different constructed joint distributions.\n",
      "- Chain-rule inputs condition each success on previous successes.\n",
      "\n",
      "Limitations:\n",
      "- Marginal rates cannot be inserted into the conditional chain rule without justification.\n",
      "- No measured agent reliability is inferred from these constructions.\n",
      "- Observation, memory and retrieval maps are declared finite context transformations; they do not measure a real memory implementation.\n",
      "- Resource allowance equality is necessary for a matched ablation, not evidence of equal consumed work.\n",
      "\n",
      "Execution: completed locally; constructed inputs are not deployment measurements.\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\" width=\"576pt\" height=\"835.2pt\" viewBox=\"0 0 576 835.2\" version=\"1.1\"><title>Calculated chapter experiment</title><desc>Labeled plot of the explicitly supplied chapter inputs. See the adjacent explanation for assumptions.</desc>\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Mathematics of AI Agents Laboratory</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 835.2  L 576 835.2  L 576 0  L 0 0  z \" style=\"fill: #ffffff\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 60.922344 223.379766  L 565.2 223.379766  L 565.2 89.960234  L 60.922344 89.960234  z \" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path id=\"m7a85a0e669\" d=\"M 0 0  L 0 3.5  \" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"83.844055\" y=\"223.379766\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"83.844055\" y=\"237.977422\" transform=\"rotate(-0 83.844055 237.977422)\">0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"175.530902\" y=\"223.379766\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"175.530902\" y=\"237.977422\" transform=\"rotate(-0 175.530902 237.977422)\">20</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"267.217749\" y=\"223.379766\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"267.217749\" y=\"237.977422\" transform=\"rotate(-0 267.217749 237.977422)\">40</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"358.904595\" y=\"223.379766\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"358.904595\" y=\"237.977422\" transform=\"rotate(-0 358.904595 237.977422)\">60</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"450.591442\" y=\"223.379766\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"450.591442\" y=\"237.977422\" transform=\"rotate(-0 450.591442 237.977422)\">80</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"542.278288\" y=\"223.379766\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"542.278288\" y=\"237.977422\" transform=\"rotate(-0 542.278288 237.977422)\">100</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_7\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"313.061172\" y=\"251.977422\" transform=\"rotate(-0 313.061172 251.977422)\">step count</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path d=\"M 60.922344 210.81656  L 565.2 210.81656  \" clip-path=\"url(#pd86568b3ea)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\">\n",
       "      <defs>\n",
       "       <path id=\"m625f594a28\" d=\"M 0 0  L -3.5 0  \" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"210.81656\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"214.615388\" transform=\"rotate(-0 53.922344 214.615388)\">0.4</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path d=\"M 60.922344 172.552626  L 565.2 172.552626  \" clip-path=\"url(#pd86568b3ea)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"172.552626\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"176.351454\" transform=\"rotate(-0 53.922344 176.351454)\">0.6</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path d=\"M 60.922344 134.288692  L 565.2 134.288692  \" clip-path=\"url(#pd86568b3ea)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"134.288692\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"138.087521\" transform=\"rotate(-0 53.922344 138.087521)\">0.8</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path d=\"M 60.922344 96.024759  L 565.2 96.024759  \" clip-path=\"url(#pd86568b3ea)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"96.024759\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"99.823587\" transform=\"rotate(-0 53.922344 99.823587)\">1.0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_12\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"31.616875\" y=\"156.67\" transform=\"rotate(-90 31.616875 156.67)\">completion probability</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_15\">\n",
       "    <path d=\"M 83.844055 96.024759  L 88.428398 97.937955  L 93.01274 99.83202  L 97.597082 101.707144  L 102.181425 103.563517  L 106.765767 105.401326  L 111.350109 107.220757  L 115.934452 109.021994  L 120.518794 110.805218  L 125.103136 112.57061  L 129.687479 114.318348  L 134.271821 116.048609  L 138.856163 117.761567  L 143.440506 119.457396  L 148.024848 121.136266  L 152.60919 122.798348  L 157.193533 124.443809  L 161.777875 126.072815  L 166.362217 127.685531  L 170.94656 129.28212  L 175.530902 130.862743  L 180.115244 132.42756  L 184.699587 133.976729  L 189.283929 135.510406  L 193.868271 137.028746  L 198.452614 138.531903  L 203.036956 140.020028  L 207.621298 141.493272  L 212.205641 142.951783  L 216.789983 144.39571  L 221.374325 145.825197  L 225.958668 147.240389  L 230.54301 148.64143  L 235.127352 150.02846  L 239.711695 151.401619  L 244.296037 152.761048  L 248.880379 154.106881  L 253.464722 155.439257  L 258.049064 156.758308  L 262.633406 158.06417  L 267.217749 159.356972  L 271.802091 160.636847  L 276.386433 161.903923  L 280.970776 163.158328  L 285.555118 164.400189  L 290.13946 165.629631  L 294.723803 166.846779  L 299.308145 168.051756  L 303.892487 169.244682  L 308.47683 170.42568  L 313.061172 171.594867  L 317.645514 172.752363  L 322.229857 173.898283  L 326.814199 175.032745  L 331.398541 176.155862  L 335.982884 177.267747  L 340.567226 178.368514  L 345.151568 179.458273  L 349.735911 180.537135  L 354.320253 181.605208  L 358.904595 182.6626  L 363.488937 183.709418  L 368.07328 184.745768  L 372.657622 185.771755  L 377.241964 186.787482  L 381.826307 187.793051  L 386.410649 188.788565  L 390.994991 189.774124  L 395.579334 190.749827  L 400.163676 191.715773  L 404.748018 192.672059  L 409.332361 193.618783  L 413.916703 194.556039  L 418.501045 195.483923  L 423.085388 196.402528  L 427.66973 197.311947  L 432.254072 198.212272  L 436.838415 199.103594  L 441.422757 199.986002  L 446.007099 200.859586  L 450.591442 201.724435  L 455.175784 202.580635  L 459.760126 203.428273  L 464.344469 204.267434  L 468.928811 205.098204  L 473.513153 205.920666  L 478.097496 206.734904  L 482.681838 207.540999  L 487.26618 208.339033  L 491.850523 209.129087  L 496.434865 209.911241  L 501.019207 210.685573  L 505.60355 211.452161  L 510.187892 212.211084  L 514.772234 212.962417  L 519.356577 213.706237  L 523.940919 214.442619  L 528.525261 215.171637  L 533.109604 215.893365  L 537.693946 216.607876  L 542.278288 217.315241  \" clip-path=\"url(#pd86568b3ea)\" style=\"fill: none; stroke: #31586b; stroke-width: 1.8; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 60.922344 223.379766  L 60.922344 89.960234  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 60.922344 223.379766  L 565.2 223.379766  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"text_13\">\n",
       "    <text style=\"font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: start\" x=\"60.922344\" y=\"83.960234\" transform=\"rotate(-0 60.922344 83.960234)\">independent trajectory success</text>\n",
       "   </g>\n",
       "  </g>\n",
       "  <g id=\"axes_2\">\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 60.922344 413.279062  L 565.2 413.279062  L 565.2 279.859531  L 60.922344 279.859531  z \" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_3\">\n",
       "    <g id=\"xtick_7\">\n",
       "     <g id=\"line2d_16\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"83.844055\" y=\"413.279062\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_14\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"83.844055\" y=\"427.876719\" transform=\"rotate(-0 83.844055 427.876719)\">0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_8\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"175.530902\" y=\"413.279062\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_15\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"175.530902\" y=\"427.876719\" transform=\"rotate(-0 175.530902 427.876719)\">20</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_9\">\n",
       "     <g id=\"line2d_18\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"267.217749\" y=\"413.279062\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_16\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"267.217749\" y=\"427.876719\" transform=\"rotate(-0 267.217749 427.876719)\">40</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_10\">\n",
       "     <g id=\"line2d_19\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"358.904595\" y=\"413.279062\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_17\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"358.904595\" y=\"427.876719\" transform=\"rotate(-0 358.904595 427.876719)\">60</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_11\">\n",
       "     <g id=\"line2d_20\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"450.591442\" y=\"413.279062\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_18\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"450.591442\" y=\"427.876719\" transform=\"rotate(-0 450.591442 427.876719)\">80</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_12\">\n",
       "     <g id=\"line2d_21\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"542.278288\" y=\"413.279062\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_19\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"542.278288\" y=\"427.876719\" transform=\"rotate(-0 542.278288 427.876719)\">100</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_20\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"313.061172\" y=\"441.876719\" transform=\"rotate(-0 313.061172 441.876719)\">step count</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_4\">\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_22\">\n",
       "      <path d=\"M 60.922344 407.214538  L 565.2 407.214538  \" clip-path=\"url(#pf7cf7d9557)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_23\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"407.214538\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_21\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"411.013366\" transform=\"rotate(-0 53.922344 411.013366)\">0.990</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_24\">\n",
       "      <path d=\"M 60.922344 382.956442  L 565.2 382.956442  \" clip-path=\"url(#pf7cf7d9557)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_25\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"382.956442\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_22\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"386.75527\" transform=\"rotate(-0 53.922344 386.75527)\">0.992</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_26\">\n",
       "      <path d=\"M 60.922344 358.698345  L 565.2 358.698345  \" clip-path=\"url(#pf7cf7d9557)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_27\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"358.698345\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_23\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"362.497173\" transform=\"rotate(-0 53.922344 362.497173)\">0.994</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_8\">\n",
       "     <g id=\"line2d_28\">\n",
       "      <path d=\"M 60.922344 334.440249  L 565.2 334.440249  \" clip-path=\"url(#pf7cf7d9557)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_29\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"334.440249\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_24\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"338.239077\" transform=\"rotate(-0 53.922344 338.239077)\">0.996</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_9\">\n",
       "     <g id=\"line2d_30\">\n",
       "      <path d=\"M 60.922344 310.182152  L 565.2 310.182152  \" clip-path=\"url(#pf7cf7d9557)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_31\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"310.182152\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_25\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"313.98098\" transform=\"rotate(-0 53.922344 313.98098)\">0.998</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_10\">\n",
       "     <g id=\"line2d_32\">\n",
       "      <path d=\"M 60.922344 285.924055  L 565.2 285.924055  \" clip-path=\"url(#pf7cf7d9557)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_33\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"285.924055\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_26\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"289.722884\" transform=\"rotate(-0 53.922344 289.722884)\">1.000</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_27\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"18.891875\" y=\"346.569297\" transform=\"rotate(-90 18.891875 346.569297)\">completion probability</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_34\">\n",
       "    <path d=\"M 83.844055 285.924055  L 88.428398 407.214538  L 93.01274 407.214538  L 97.597082 407.214538  L 102.181425 407.214538  L 106.765767 407.214538  L 111.350109 407.214538  L 115.934452 407.214538  L 120.518794 407.214538  L 125.103136 407.214538  L 129.687479 407.214538  L 134.271821 407.214538  L 138.856163 407.214538  L 143.440506 407.214538  L 148.024848 407.214538  L 152.60919 407.214538  L 157.193533 407.214538  L 161.777875 407.214538  L 166.362217 407.214538  L 170.94656 407.214538  L 175.530902 407.214538  L 180.115244 407.214538  L 184.699587 407.214538  L 189.283929 407.214538  L 193.868271 407.214538  L 198.452614 407.214538  L 203.036956 407.214538  L 207.621298 407.214538  L 212.205641 407.214538  L 216.789983 407.214538  L 221.374325 407.214538  L 225.958668 407.214538  L 230.54301 407.214538  L 235.127352 407.214538  L 239.711695 407.214538  L 244.296037 407.214538  L 248.880379 407.214538  L 253.464722 407.214538  L 258.049064 407.214538  L 262.633406 407.214538  L 267.217749 407.214538  L 271.802091 407.214538  L 276.386433 407.214538  L 280.970776 407.214538  L 285.555118 407.214538  L 290.13946 407.214538  L 294.723803 407.214538  L 299.308145 407.214538  L 303.892487 407.214538  L 308.47683 407.214538  L 313.061172 407.214538  L 317.645514 407.214538  L 322.229857 407.214538  L 326.814199 407.214538  L 331.398541 407.214538  L 335.982884 407.214538  L 340.567226 407.214538  L 345.151568 407.214538  L 349.735911 407.214538  L 354.320253 407.214538  L 358.904595 407.214538  L 363.488937 407.214538  L 368.07328 407.214538  L 372.657622 407.214538  L 377.241964 407.214538  L 381.826307 407.214538  L 386.410649 407.214538  L 390.994991 407.214538  L 395.579334 407.214538  L 400.163676 407.214538  L 404.748018 407.214538  L 409.332361 407.214538  L 413.916703 407.214538  L 418.501045 407.214538  L 423.085388 407.214538  L 427.66973 407.214538  L 432.254072 407.214538  L 436.838415 407.214538  L 441.422757 407.214538  L 446.007099 407.214538  L 450.591442 407.214538  L 455.175784 407.214538  L 459.760126 407.214538  L 464.344469 407.214538  L 468.928811 407.214538  L 473.513153 407.214538  L 478.097496 407.214538  L 482.681838 407.214538  L 487.26618 407.214538  L 491.850523 407.214538  L 496.434865 407.214538  L 501.019207 407.214538  L 505.60355 407.214538  L 510.187892 407.214538  L 514.772234 407.214538  L 519.356577 407.214538  L 523.940919 407.214538  L 528.525261 407.214538  L 533.109604 407.214538  L 537.693946 407.214538  L 542.278288 407.214538  \" clip-path=\"url(#pf7cf7d9557)\" style=\"fill: none; stroke: #31586b; stroke-width: 1.8; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 60.922344 413.279062  L 60.922344 279.859531  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_7\">\n",
       "    <path d=\"M 60.922344 413.279062  L 565.2 413.279062  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"text_28\">\n",
       "    <text style=\"font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: start\" x=\"60.922344\" y=\"273.859531\" transform=\"rotate(-0 60.922344 273.859531)\">shared condition trajectory success</text>\n",
       "   </g>\n",
       "  </g>\n",
       "  <g id=\"axes_3\">\n",
       "   <g id=\"patch_8\">\n",
       "    <path d=\"M 60.922344 603.178359  L 565.2 603.178359  L 565.2 469.758828  L 60.922344 469.758828  z \" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_5\">\n",
       "    <g id=\"xtick_13\">\n",
       "     <g id=\"line2d_35\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"83.844055\" y=\"603.178359\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_29\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"83.844055\" y=\"617.776016\" transform=\"rotate(-0 83.844055 617.776016)\">0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_14\">\n",
       "     <g id=\"line2d_36\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"175.530902\" y=\"603.178359\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_30\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"175.530902\" y=\"617.776016\" transform=\"rotate(-0 175.530902 617.776016)\">20</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_15\">\n",
       "     <g id=\"line2d_37\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"267.217749\" y=\"603.178359\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_31\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"267.217749\" y=\"617.776016\" transform=\"rotate(-0 267.217749 617.776016)\">40</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_16\">\n",
       "     <g id=\"line2d_38\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"358.904595\" y=\"603.178359\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_32\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"358.904595\" y=\"617.776016\" transform=\"rotate(-0 358.904595 617.776016)\">60</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_17\">\n",
       "     <g id=\"line2d_39\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"450.591442\" y=\"603.178359\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_33\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"450.591442\" y=\"617.776016\" transform=\"rotate(-0 450.591442 617.776016)\">80</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_18\">\n",
       "     <g id=\"line2d_40\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"542.278288\" y=\"603.178359\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_34\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"542.278288\" y=\"617.776016\" transform=\"rotate(-0 542.278288 617.776016)\">100</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_35\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"313.061172\" y=\"631.776797\" transform=\"rotate(-0 313.061172 631.776797)\">transition count</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_6\">\n",
       "    <g id=\"ytick_11\">\n",
       "     <g id=\"line2d_41\">\n",
       "      <path d=\"M 60.922344 584.984787  L 565.2 584.984787  \" clip-path=\"url(#pa7574b87ff)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_42\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"584.984787\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_36\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"588.783615\" transform=\"rotate(-0 53.922344 588.783615)\">0.4</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_12\">\n",
       "     <g id=\"line2d_43\">\n",
       "      <path d=\"M 60.922344 548.597642  L 565.2 548.597642  \" clip-path=\"url(#pa7574b87ff)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_44\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"548.597642\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_37\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"552.39647\" transform=\"rotate(-0 53.922344 552.39647)\">0.6</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_13\">\n",
       "     <g id=\"line2d_45\">\n",
       "      <path d=\"M 60.922344 512.210497  L 565.2 512.210497  \" clip-path=\"url(#pa7574b87ff)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_46\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"512.210497\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_38\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"516.009325\" transform=\"rotate(-0 53.922344 516.009325)\">0.8</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_14\">\n",
       "     <g id=\"line2d_47\">\n",
       "      <path d=\"M 60.922344 475.823352  L 565.2 475.823352  \" clip-path=\"url(#pa7574b87ff)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_48\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"475.823352\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_39\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"479.62218\" transform=\"rotate(-0 53.922344 479.62218)\">1.0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_40\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"31.616875\" y=\"536.468594\" transform=\"rotate(-90 31.616875 536.468594)\">probability</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_49\">\n",
       "    <path d=\"M 83.844055 475.823352  L 88.428398 566.791214  L 93.01274 589.53318  L 97.597082 595.218671  L 102.181425 596.640044  L 106.765767 596.995387  L 111.350109 597.084223  L 115.934452 597.106432  L 120.518794 597.111984  L 125.103136 597.113373  L 129.687479 597.11372  L 134.271821 597.113806  L 138.856163 597.113828  L 143.440506 597.113833  L 148.024848 597.113835  L 152.60919 597.113835  L 157.193533 597.113835  L 161.777875 597.113835  L 166.362217 597.113835  L 170.94656 597.113835  L 175.530902 597.113835  L 180.115244 597.113835  L 184.699587 597.113835  L 189.283929 597.113835  L 193.868271 597.113835  L 198.452614 597.113835  L 203.036956 597.113835  L 207.621298 597.113835  L 212.205641 597.113835  L 216.789983 597.113835  L 221.374325 597.113835  L 225.958668 597.113835  L 230.54301 597.113835  L 235.127352 597.113835  L 239.711695 597.113835  L 244.296037 597.113835  L 248.880379 597.113835  L 253.464722 597.113835  L 258.049064 597.113835  L 262.633406 597.113835  L 267.217749 597.113835  L 271.802091 597.113835  L 276.386433 597.113835  L 280.970776 597.113835  L 285.555118 597.113835  L 290.13946 597.113835  L 294.723803 597.113835  L 299.308145 597.113835  L 303.892487 597.113835  L 308.47683 597.113835  L 313.061172 597.113835  L 317.645514 597.113835  L 322.229857 597.113835  L 326.814199 597.113835  L 331.398541 597.113835  L 335.982884 597.113835  L 340.567226 597.113835  L 345.151568 597.113835  L 349.735911 597.113835  L 354.320253 597.113835  L 358.904595 597.113835  L 363.488937 597.113835  L 368.07328 597.113835  L 372.657622 597.113835  L 377.241964 597.113835  L 381.826307 597.113835  L 386.410649 597.113835  L 390.994991 597.113835  L 395.579334 597.113835  L 400.163676 597.113835  L 404.748018 597.113835  L 409.332361 597.113835  L 413.916703 597.113835  L 418.501045 597.113835  L 423.085388 597.113835  L 427.66973 597.113835  L 432.254072 597.113835  L 436.838415 597.113835  L 441.422757 597.113835  L 446.007099 597.113835  L 450.591442 597.113835  L 455.175784 597.113835  L 459.760126 597.113835  L 464.344469 597.113835  L 468.928811 597.113835  L 473.513153 597.113835  L 478.097496 597.113835  L 482.681838 597.113835  L 487.26618 597.113835  L 491.850523 597.113835  L 496.434865 597.113835  L 501.019207 597.113835  L 505.60355 597.113835  L 510.187892 597.113835  L 514.772234 597.113835  L 519.356577 597.113835  L 523.940919 597.113835  L 528.525261 597.113835  L 533.109604 597.113835  L 537.693946 597.113835  L 542.278288 597.113835  \" clip-path=\"url(#pa7574b87ff)\" style=\"fill: none; stroke: #31586b; stroke-width: 1.8; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_9\">\n",
       "    <path d=\"M 60.922344 603.178359  L 60.922344 469.758828  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_10\">\n",
       "    <path d=\"M 60.922344 603.178359  L 565.2 603.178359  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"text_41\">\n",
       "    <text style=\"font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: start\" x=\"60.922344\" y=\"463.758828\" transform=\"rotate(-0 60.922344 463.758828)\">state zero occupancy</text>\n",
       "   </g>\n",
       "  </g>\n",
       "  <g id=\"axes_4\">\n",
       "   <g id=\"patch_11\">\n",
       "    <path d=\"M 60.922344 793.077656  L 565.2 793.077656  L 565.2 659.658125  L 60.922344 659.658125  z \" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_7\">\n",
       "    <g id=\"xtick_19\">\n",
       "     <g id=\"line2d_50\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"83.844055\" y=\"793.077656\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_42\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"83.844055\" y=\"807.675313\" transform=\"rotate(-0 83.844055 807.675313)\">0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_20\">\n",
       "     <g id=\"line2d_51\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"198.452614\" y=\"793.077656\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_43\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"198.452614\" y=\"807.675313\" transform=\"rotate(-0 198.452614 807.675313)\">1</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_21\">\n",
       "     <g id=\"line2d_52\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"313.061172\" y=\"793.077656\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_44\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"313.061172\" y=\"807.675313\" transform=\"rotate(-0 313.061172 807.675313)\">2</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_22\">\n",
       "     <g id=\"line2d_53\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"427.66973\" y=\"793.077656\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_45\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"427.66973\" y=\"807.675313\" transform=\"rotate(-0 427.66973 807.675313)\">3</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_23\">\n",
       "     <g id=\"line2d_54\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m7a85a0e669\" x=\"542.278288\" y=\"793.077656\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_46\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"542.278288\" y=\"807.675313\" transform=\"rotate(-0 542.278288 807.675313)\">4</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_47\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"313.061172\" y=\"821.676094\" transform=\"rotate(-0 313.061172 821.676094)\">assembly index (see table)</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_8\">\n",
       "    <g id=\"ytick_15\">\n",
       "     <g id=\"line2d_55\">\n",
       "      <path d=\"M 60.922344 774.8845  L 565.2 774.8845  \" clip-path=\"url(#pe977602d33)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_56\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"774.8845\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_48\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"778.683328\" transform=\"rotate(-0 53.922344 778.683328)\">0.35</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_16\">\n",
       "     <g id=\"line2d_57\">\n",
       "      <path d=\"M 60.922344 738.497217  L 565.2 738.497217  \" clip-path=\"url(#pe977602d33)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_58\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"738.497217\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_49\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"742.296045\" transform=\"rotate(-0 53.922344 742.296045)\">0.40</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_17\">\n",
       "     <g id=\"line2d_59\">\n",
       "      <path d=\"M 60.922344 702.109933  L 565.2 702.109933  \" clip-path=\"url(#pe977602d33)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_60\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"702.109933\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_50\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"705.908761\" transform=\"rotate(-0 53.922344 705.908761)\">0.45</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_18\">\n",
       "     <g id=\"line2d_61\">\n",
       "      <path d=\"M 60.922344 665.722649  L 565.2 665.722649  \" clip-path=\"url(#pe977602d33)\" style=\"fill: none; stroke: #d4d8da; stroke-width: 0.6; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_62\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m625f594a28\" x=\"60.922344\" y=\"665.722649\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_51\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: end\" x=\"53.922344\" y=\"669.521477\" transform=\"rotate(-0 53.922344 669.521477)\">0.50</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_52\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: middle\" x=\"25.254375\" y=\"726.367891\" transform=\"rotate(-90 25.254375 726.367891)\">probability</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_63\">\n",
       "    <path d=\"M 83.844055 787.013132  L 198.452614 756.690858  L 313.061172 756.690858  L 427.66973 756.690858  L 542.278288 665.722649  \" clip-path=\"url(#pe977602d33)\" style=\"fill: none; stroke: #31586b; stroke-width: 1.8; stroke-linecap: square\"/>\n",
       "    <defs>\n",
       "     <path id=\"m161905df60\" d=\"M 0 2  C 0.530406 2 1.03916 1.789267 1.414214 1.414214  C 1.789267 1.03916 2 0.530406 2 0  C 2 -0.530406 1.789267 -1.03916 1.414214 -1.414214  C 1.03916 -1.789267 0.530406 -2 0 -2  C -0.530406 -2 -1.03916 -1.789267 -1.414214 -1.414214  C -1.789267 -1.03916 -2 -0.530406 -2 0  C -2 0.530406 -1.789267 1.03916 -1.414214 1.414214  C -1.03916 1.789267 -0.530406 2 0 2  z \" style=\"stroke: #31586b\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#pe977602d33)\">\n",
       "     <use xlink:href=\"#m161905df60\" x=\"83.844055\" y=\"787.013132\" style=\"fill: #31586b; stroke: #31586b\"/>\n",
       "     <use xlink:href=\"#m161905df60\" x=\"198.452614\" y=\"756.690858\" style=\"fill: #31586b; stroke: #31586b\"/>\n",
       "     <use xlink:href=\"#m161905df60\" x=\"313.061172\" y=\"756.690858\" style=\"fill: #31586b; stroke: #31586b\"/>\n",
       "     <use xlink:href=\"#m161905df60\" x=\"427.66973\" y=\"756.690858\" style=\"fill: #31586b; stroke: #31586b\"/>\n",
       "     <use xlink:href=\"#m161905df60\" x=\"542.278288\" y=\"665.722649\" style=\"fill: #31586b; stroke: #31586b\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_12\">\n",
       "    <path d=\"M 60.922344 793.077656  L 60.922344 659.658125  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_13\">\n",
       "    <path d=\"M 60.922344 793.077656  L 565.2 793.077656  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"text_53\">\n",
       "    <text style=\"font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: start\" x=\"60.922344\" y=\"653.658125\" transform=\"rotate(-0 60.922344 653.658125)\">assembled terminal state-zero probability</text>\n",
       "   </g>\n",
       "  </g>\n",
       "  <g id=\"text_54\">\n",
       "   <text style=\"font-size: 12px; font-family: 'DejaVu Sans'; text-anchor: start\" x=\"46.08\" y=\"25.822125\" transform=\"rotate(-0 46.08 25.822125)\">Chapter 5: composite kernel</text>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pd86568b3ea\">\n",
       "   <rect x=\"60.922344\" y=\"89.960234\" width=\"504.277656\" height=\"133.419531\"/>\n",
       "  </clipPath>\n",
       "  <clipPath id=\"pf7cf7d9557\">\n",
       "   <rect x=\"60.922344\" y=\"279.859531\" width=\"504.277656\" height=\"133.419531\"/>\n",
       "  </clipPath>\n",
       "  <clipPath id=\"pa7574b87ff\">\n",
       "   <rect x=\"60.922344\" y=\"469.758828\" width=\"504.277656\" height=\"133.419531\"/>\n",
       "  </clipPath>\n",
       "  <clipPath id=\"pe977602d33\">\n",
       "   <rect x=\"60.922344\" y=\"659.658125\" width=\"504.277656\" height=\"133.419531\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "changed_inputs = {'step_success': 0.99,\n",
    " 'steps': 100,\n",
    " 'conditional_success': [0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99,\n",
    "                         0.99],\n",
    " 'chooser': [[0.8, 0.2], [0.3, 0.7]],\n",
    " 'tool': [[0.6, 0.4], [0.1, 0.9]],\n",
    " 'initial': [1, 0],\n",
    " 'assemblies': [{'name': 'complete',\n",
    "                 'budget': 100,\n",
    "                 'steps': 10,\n",
    "                 'observation': [[1, 0], [0, 1]],\n",
    "                 'memory': [[1, 0], [0, 1]],\n",
    "                 'retrieval': [[1, 0], [0, 1]],\n",
    "                 'tool': [[0.6, 0.4], [0.1, 0.9]]},\n",
    "                {'name': 'memory blurred',\n",
    "                 'budget': 100,\n",
    "                 'steps': 10,\n",
    "                 'observation': [[1, 0], [0, 1]],\n",
    "                 'memory': [[0.5, 0.5], [0.5, 0.5]],\n",
    "                 'retrieval': [[1, 0], [0, 1]],\n",
    "                 'tool': [[0.6, 0.4], [0.1, 0.9]]},\n",
    "                {'name': 'retrieval blurred',\n",
    "                 'budget': 100,\n",
    "                 'steps': 10,\n",
    "                 'observation': [[1, 0], [0, 1]],\n",
    "                 'memory': [[1, 0], [0, 1]],\n",
    "                 'retrieval': [[0.5, 0.5], [0.5, 0.5]],\n",
    "                 'tool': [[0.6, 0.4], [0.1, 0.9]]},\n",
    "                {'name': 'observation blurred',\n",
    "                 'budget': 100,\n",
    "                 'steps': 10,\n",
    "                 'observation': [[0.5, 0.5], [0.5, 0.5]],\n",
    "                 'memory': [[1, 0], [0, 1]],\n",
    "                 'retrieval': [[1, 0], [0, 1]],\n",
    "                 'tool': [[0.6, 0.4], [0.1, 0.9]]},\n",
    "                {'name': 'single transition',\n",
    "                 'budget': 100,\n",
    "                 'steps': 1,\n",
    "                 'observation': [[1, 0], [0, 1]],\n",
    "                 'memory': [[1, 0], [0, 1]],\n",
    "                 'retrieval': [[1, 0], [0, 1]],\n",
    "                 'tool': [[0.6, 0.4], [0.1, 0.9]]}]}\n",
    "changed = analyze(chapter, changed_inputs)\n",
    "changed['evidence_kind'] = 'constructed changed-assumption example'\n",
    "print(report_text(changed))\n",
    "display(SVG(figure_svg(changed)))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ef10a02227b8",
   "metadata": {},
   "source": [
    "**Figure 5.L2:** The changed-assumption result. Compare the printed quantities and the stated assumptions with the first run. A different input need not imply a causal effect in a deployed agent."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f19ee53e81d2",
   "metadata": {},
   "source": [
    "## Try a new case\n",
    "\n",
    "The transfer case uses three conditional probabilities 0.9,0.8,0.7. Their chain-rule product is 0.504. The equal marginal independent construction gives 0.9^3=0.729, while the shared construction gives 0.9. They answer different distributional questions.\n",
    "\n",
    "For a local controller, specify the complete state sufficient for one transition, then identify the chooser and effect boundary. If data provide only run-level completions, route them to the evaluation method instead of manufacturing a step kernel. If they provide uncertain tool acknowledgements, use an effect trace. The right reliability calculation follows the available evidence, not the presence of a convenient average."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "94db838e59f6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Chapter 5: composite-kernel\n",
      "What system does a frozen chooser become when its surrounding kernel changes?\n",
      "Evidence: constructed transfer example\n",
      "\n",
      "Calculated quantities:\n",
      "{\n",
      "  \"assemblies\": [\n",
      "    {\n",
      "      \"assembly\": \"complete\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.7,\n",
      "          0.3\n",
      "        ],\n",
      "        [\n",
      "          0.4,\n",
      "          0.6\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.5714281496,\n",
      "        0.4285718503\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"memory blurred\",\n",
      "      \"budget\": 120.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.55,\n",
      "          0.45\n",
      "        ],\n",
      "        [\n",
      "          0.55,\n",
      "          0.45\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.55,\n",
      "        0.45\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"retrieval blurred\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.55,\n",
      "          0.45\n",
      "        ],\n",
      "        [\n",
      "          0.55,\n",
      "          0.45\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.55,\n",
      "        0.45\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"observation blurred\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.55,\n",
      "          0.45\n",
      "        ],\n",
      "        [\n",
      "          0.55,\n",
      "          0.45\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.55,\n",
      "        0.45\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"single transition\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 1,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.7,\n",
      "          0.3\n",
      "        ],\n",
      "        [\n",
      "          0.4,\n",
      "          0.6\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.55,\n",
      "        0.45\n",
      "      ]\n",
      "    }\n",
      "  ],\n",
      "  \"assembly_budgets_matched\": false,\n",
      "  \"assembly_depths_matched\": false,\n",
      "  \"composite_kernel\": [\n",
      "    [\n",
      "      0.7,\n",
      "      0.3\n",
      "    ],\n",
      "    [\n",
      "      0.4,\n",
      "      0.6\n",
      "    ]\n",
      "  ],\n",
      "  \"terminal_distribution\": [\n",
      "    0.5695,\n",
      "    0.4305\n",
      "  ],\n",
      "  \"independent_all_success\": 0.729,\n",
      "  \"shared_condition_all_success\": 0.9,\n",
      "  \"chain_rule_all_success\": 0.504\n",
      "}\n",
      "\n",
      "Interpretation:\n",
      "The frozen chooser and tool jointly define the state kernel. Equal marginal step success can coexist with sharply different trajectory reliability.\n",
      "\n",
      "Assumptions:\n",
      "- Kernel factors use the declared state and action boundary.\n",
      "- Independent and shared-condition cases are different constructed joint distributions.\n",
      "- Chain-rule inputs condition each success on previous successes.\n",
      "\n",
      "Limitations:\n",
      "- Marginal rates cannot be inserted into the conditional chain rule without justification.\n",
      "- No measured agent reliability is inferred from these constructions.\n",
      "- Observation, memory and retrieval maps are declared finite context transformations; they do not measure a real memory implementation.\n",
      "- Resource allowance equality is necessary for a matched ablation, not evidence of equal consumed work.\n",
      "\n",
      "Execution: completed locally; constructed inputs are not deployment measurements.\n"
     ]
    }
   ],
   "source": [
    "transfer_inputs = {'step_success': 0.9,\n",
    " 'steps': 3,\n",
    " 'conditional_success': [0.9, 0.8, 0.7],\n",
    " 'chooser': [[1, 0], [0, 1]],\n",
    " 'tool': [[0.7, 0.3], [0.4, 0.6]],\n",
    " 'initial': [0.5, 0.5],\n",
    " 'assemblies': [{'name': 'complete',\n",
    "                 'budget': 100,\n",
    "                 'steps': 10,\n",
    "                 'observation': [[1, 0], [0, 1]],\n",
    "                 'memory': [[1, 0], [0, 1]],\n",
    "                 'retrieval': [[1, 0], [0, 1]],\n",
    "                 'tool': [[0.7, 0.3], [0.4, 0.6]]},\n",
    "                {'name': 'memory blurred',\n",
    "                 'budget': 120,\n",
    "                 'steps': 10,\n",
    "                 'observation': [[1, 0], [0, 1]],\n",
    "                 'memory': [[0.5, 0.5], [0.5, 0.5]],\n",
    "                 'retrieval': [[1, 0], [0, 1]],\n",
    "                 'tool': [[0.7, 0.3], [0.4, 0.6]]},\n",
    "                {'name': 'retrieval blurred',\n",
    "                 'budget': 100,\n",
    "                 'steps': 10,\n",
    "                 'observation': [[1, 0], [0, 1]],\n",
    "                 'memory': [[1, 0], [0, 1]],\n",
    "                 'retrieval': [[0.5, 0.5], [0.5, 0.5]],\n",
    "                 'tool': [[0.7, 0.3], [0.4, 0.6]]},\n",
    "                {'name': 'observation blurred',\n",
    "                 'budget': 100,\n",
    "                 'steps': 10,\n",
    "                 'observation': [[0.5, 0.5], [0.5, 0.5]],\n",
    "                 'memory': [[1, 0], [0, 1]],\n",
    "                 'retrieval': [[1, 0], [0, 1]],\n",
    "                 'tool': [[0.7, 0.3], [0.4, 0.6]]},\n",
    "                {'name': 'single transition',\n",
    "                 'budget': 100,\n",
    "                 'steps': 1,\n",
    "                 'observation': [[1, 0], [0, 1]],\n",
    "                 'memory': [[1, 0], [0, 1]],\n",
    "                 'retrieval': [[1, 0], [0, 1]],\n",
    "                 'tool': [[0.7, 0.3], [0.4, 0.6]]}]}\n",
    "transfer = analyze(chapter, transfer_inputs)\n",
    "transfer['evidence_kind'] = 'constructed transfer example'\n",
    "print(report_text(transfer))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7851f9a2f678",
   "metadata": {},
   "source": [
    "## Apply the method to your inputs\n",
    "\n",
    "The example file below has the exact input shape the method accepts. Copy it to a new file, replace its values, then point `reader_file` at your copy. Run the cell again. Supplied inputs retain their stated provenance; the program cannot establish that they are representative observations.\n",
    "\n",
    "- **step_success:** Marginal equal-step probability in [0,1] for separate constructed reliability cases.\n",
    "- **steps:** Positive integer transition count up to 1000.\n",
    "- **conditional_success:** List of probabilities conditioned on all previous steps succeeding, one per step; its length must equal steps.\n",
    "- **chooser:** State by action row-stochastic matrix.\n",
    "- **tool:** Action by next-state row-stochastic matrix.\n",
    "- **initial:** Normalized state distribution matching the composed kernel.\n",
    "- **assemblies:** Optional rows with name,budget,steps,observation,memory,retrieval,tool. Context maps are square stochastic matrices in the declared context encoding. Chooser stays fixed. Resource allowances must share units; actual consumed work is not measured."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "82c80b8a6220",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Chapter 5: composite-kernel\n",
      "What system does a frozen chooser become when its surrounding kernel changes?\n",
      "Evidence: supplied local inputs; provenance not independently verified\n",
      "\n",
      "Calculated quantities:\n",
      "{\n",
      "  \"assemblies\": [\n",
      "    {\n",
      "      \"assembly\": \"complete\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.7,\n",
      "          0.3\n",
      "        ],\n",
      "        [\n",
      "          0.4,\n",
      "          0.6\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.5714281496,\n",
      "        0.4285718503\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"memory blurred\",\n",
      "      \"budget\": 120.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.55,\n",
      "          0.45\n",
      "        ],\n",
      "        [\n",
      "          0.55,\n",
      "          0.45\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.55,\n",
      "        0.45\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"retrieval blurred\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.55,\n",
      "          0.45\n",
      "        ],\n",
      "        [\n",
      "          0.55,\n",
      "          0.45\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.55,\n",
      "        0.45\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"observation blurred\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 10,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.55,\n",
      "          0.45\n",
      "        ],\n",
      "        [\n",
      "          0.55,\n",
      "          0.45\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.55,\n",
      "        0.45\n",
      "      ]\n",
      "    },\n",
      "    {\n",
      "      \"assembly\": \"single transition\",\n",
      "      \"budget\": 100.0,\n",
      "      \"steps\": 1,\n",
      "      \"kernel\": [\n",
      "        [\n",
      "          0.7,\n",
      "          0.3\n",
      "        ],\n",
      "        [\n",
      "          0.4,\n",
      "          0.6\n",
      "        ]\n",
      "      ],\n",
      "      \"terminal_distribution\": [\n",
      "        0.55,\n",
      "        0.45\n",
      "      ]\n",
      "    }\n",
      "  ],\n",
      "  \"assembly_budgets_matched\": false,\n",
      "  \"assembly_depths_matched\": false,\n",
      "  \"composite_kernel\": [\n",
      "    [\n",
      "      0.7,\n",
      "      0.3\n",
      "    ],\n",
      "    [\n",
      "      0.4,\n",
      "      0.6\n",
      "    ]\n",
      "  ],\n",
      "  \"terminal_distribution\": [\n",
      "    0.5695,\n",
      "    0.4305\n",
      "  ],\n",
      "  \"independent_all_success\": 0.729,\n",
      "  \"shared_condition_all_success\": 0.9,\n",
      "  \"chain_rule_all_success\": 0.504\n",
      "}\n",
      "\n",
      "Interpretation:\n",
      "The frozen chooser and tool jointly define the state kernel. Equal marginal step success can coexist with sharply different trajectory reliability.\n",
      "\n",
      "Assumptions:\n",
      "- Kernel factors use the declared state and action boundary.\n",
      "- Independent and shared-condition cases are different constructed joint distributions.\n",
      "- Chain-rule inputs condition each success on previous successes.\n",
      "\n",
      "Limitations:\n",
      "- Marginal rates cannot be inserted into the conditional chain rule without justification.\n",
      "- No measured agent reliability is inferred from these constructions.\n",
      "- Observation, memory and retrieval maps are declared finite context transformations; they do not measure a real memory implementation.\n",
      "- Resource allowance equality is necessary for a matched ablation, not evidence of equal consumed work.\n",
      "\n",
      "Execution: completed locally; constructed inputs are not deployment measurements.\n"
     ]
    }
   ],
   "source": [
    "reader_file = LAB_ROOT / 'data/examples/ch05.json'\n",
    "reader_inputs = json.loads(reader_file.read_text())\n",
    "reader_report = analyze(chapter, reader_inputs)\n",
    "print(report_text(reader_report))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e2825f944d9e",
   "metadata": {},
   "source": [
    "## Questions\n",
    "\n",
    "1. Compute the default first kernel row.\n",
    "\n",
    "2. Why can an independent-step model and a shared good-or-bad-condition model both have step marginals p?\n",
    "\n",
    "3. Compute the transfer conditional product.\n",
    "\n",
    "Answers: [separate solutions](../solutions/ch05.md). Try the calculation before opening them."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "30fa93b1754c",
   "metadata": {},
   "source": [
    "## Summary\n",
    "\n",
    "An assembled agent has a composite transition kernel. A fixed chooser can behave differently when tool effects change, and recurrence exposes those differences over time. Trajectory reliability depends on joint or conditional structure: equal marginal rates support neither independence nor a universal ceiling. Keep kernel composition, independent construction, shared-condition construction, and chain-rule inputs distinct. The notebook calculates each honestly, while leaving recovery and empirical calibration outside its implemented boundary. The optional factor table holds the chooser fixed while inspecting context transformations and recurrence, and reports allowance and depth comparability explicitly.\n",
    "\n",
    "Limits of this experiment:\n",
    "\n",
    "- This is a local calculation under declared inputs, not an empirical claim about a deployed agent.\n",
    "- Read the returned assumptions and limitations before applying the numerical result.\n",
    "\n",
    "The assistant skill is [`maa-05-composite-kernel`](../skills/maa-05-composite-kernel/SKILL.md). It uses this notebook's tested computation and input contract."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9cc9f25ba898",
   "metadata": {},
   "source": [
    "## Equations from the chapter\n",
    "\n",
    "These are the unchanged display equations and their explanations from the canonical chapter. They are a reference for the experiment, not a claim that every equation is numerically implemented by this one method."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "92496da9283f",
   "metadata": {},
   "source": [
    "### Equation un-numbered display 1\n",
    "\n",
    "![Equation un-numbered display 1](../assets/math/788eb3973bb881ecf8ff.svg)\n",
    "\n",
    "\n",
    "\n",
    "LaTeX source, preserved for inspection:\n",
    "\n",
    "```latex\n",
    "0.90(0.85)+0.10(0.10)=0.775.\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5dbbdfbe0e25",
   "metadata": {},
   "source": [
    "### Equation 5.1\n",
    "\n",
    "![Equation 5.1](../assets/math/5f46914d9ff9a53d8e15.svg)\n",
    "\n",
    "Equation (5.1) says the agent's real state is larger than its current prompt, bundling context with retained memory, the world, and the remaining budget.\n",
    "\n",
    "The state at time $t$ is the four listed coordinates held together: the context, the memory, the world, and the budget.\n",
    "\n",
    "LaTeX source, preserved for inspection:\n",
    "\n",
    "```latex\n",
    "x_t=(c_t,m_t,w_t,b_t).\n",
    "\\tag{5.1}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ad01f3fbb344",
   "metadata": {},
   "source": [
    "### Equation un-numbered display 3\n",
    "\n",
    "![Equation un-numbered display 3](../assets/math/58eccb7e6e81e54929b0.svg)\n",
    "\n",
    "\n",
    "\n",
    "LaTeX source, preserved for inspection:\n",
    "\n",
    "```latex\n",
    "\\pi_\\theta(z,a\\mid x)=K_\\theta(z\\mid c)\\operatorname{dec}(a\\mid z,c).\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5c04154bddb5",
   "metadata": {},
   "source": [
    "### Equation 5.2\n",
    "\n",
    "![Equation 5.2](../assets/math/d730604202b83b1f70fe.svg)\n",
    "\n",
    "Equation (5.2) defines every coordinate of the next state and separates a controlled transition from the policy that selects proposals.\n",
    "\n",
    "For a fixed proposal, draw the permission outcome, next world and observation, then the internal update, and average that normalized transition over the model and decoder's proposal law.\n",
    "\n",
    "LaTeX source, preserved for inspection:\n",
    "\n",
    "```latex\n",
    "\\begin{aligned}\n",
    "P_{\\mathrm{env}}(x'\\mid x,u)\n",
    " &=\\sum_{g,o}\\operatorname{Grant}(g\\mid x,u)\\\\\n",
    " &\\quad\\cdot \\operatorname{Env}(w',o\\mid x,u,g)\\\\\n",
    " &\\quad\\cdot \\operatorname{Upd}(c',m',b'\\mid x,u,g,w',o),\\\\[3pt]\n",
    "P_\\theta(x'\\mid x)\n",
    " &=\\sum_u\\pi_\\theta(u\\mid x)P_{\\mathrm{env}}(x'\\mid x,u).\n",
    "\\end{aligned}\n",
    "\\tag{5.2}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "93f192064d0d",
   "metadata": {},
   "source": [
    "### Equation 5.3\n",
    "\n",
    "![Equation 5.3](../assets/math/570697d8140dd69c230d.svg)\n",
    "\n",
    "Equation (5.3) states when merging detailed states preserves the controlled process relevant to action.\n",
    "\n",
    "From either detailed state, an allowed action must send equal probability into every abstract class.\n",
    "\n",
    "LaTeX source, preserved for inspection:\n",
    "\n",
    "```latex\n",
    "\\sum_{y:\\kappa(y)=\\bar y}P(y\\mid x_1,a)\n",
    "=\n",
    "\\sum_{y:\\kappa(y)=\\bar y}P(y\\mid x_2,a).\n",
    "\\tag{5.3}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "de6a8c7571b9",
   "metadata": {},
   "source": [
    "### Equation 5.4\n",
    "\n",
    "![Equation 5.4](../assets/math/94b9a9d7210adada496e.svg)\n",
    "\n",
    "Equation (5.4) measures how much a tool's observation actually reduces uncertainty about the thing the agent needs to know.\n",
    "\n",
    "Subtract the uncertainty remaining about $Y$ after seeing the observation from the uncertainty before it; what remains is what the observation told you.\n",
    "\n",
    "LaTeX source, preserved for inspection:\n",
    "\n",
    "```latex\n",
    "I(Y;O)=H(Y)-H(Y\\mid O).\n",
    "\\tag{5.4}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0ac349507cd3",
   "metadata": {},
   "source": [
    "### Equation 5.5\n",
    "\n",
    "![Equation 5.5](../assets/math/4bb12830ba698a772a97.svg)\n",
    "\n",
    "Equation (5.5) says a whole run's probability is a product of one-step probabilities, so recurrence multiplies rather than adds.\n",
    "\n",
    "Start from the initial state and multiply the one-step transition probabilities along the run.\n",
    "\n",
    "LaTeX source, preserved for inspection:\n",
    "\n",
    "```latex\n",
    "\\Pr(x_{0:T})=\\Pr(x_0)\\prod_{t=0}^{T-1}P(x_{t+1}\\mid x_t).\n",
    "\\tag{5.5}\n",
    "```"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Mathematics of AI Agents",
   "language": "python",
   "name": "maa-lab"
  },
  "lab_chapter": 5,
  "lab_execution": {
   "code_cells": 6,
   "created_utc": "2026-10-02T05:13:38.838010+00:00",
   "elapsed_seconds": 8.994658041978255,
   "method": "fresh process; new ipykernel InProcessKernelManager; cells submitted as Jupyter execute requests",
   "network_transport_tested": false,
   "python": "3.11.15",
   "source_sha256": "ee78cc519e329e7a821ad5f79d4220e6cd82a9e7c1f168b21ec9cd689f69dcf9"
  },
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
