{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "#"
      ],
      "id": "99a9f4cf-affd-4d81-baad-ca4cbd62767c"
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {},
      "outputs": [],
      "source": [
        "import scipy as sp"
      ],
      "id": "cf5c2839-95fb-4ce4-b370-2b1a8163e4ec"
    },
    {
      "cell_type": "code",
      "execution_count": 2,
      "metadata": {},
      "outputs": [],
      "source": [
        "X = sp.stats.expon(scale = 1.1)"
      ],
      "id": "e8598574-6e5f-46ce-9982-17f57bf09f64"
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {},
      "outputs": [
        {
          "output_type": "display_data",
          "metadata": {},
          "data": {
            "text/plain": [
              "0.24056971034728492"
            ]
          }
        }
      ],
      "source": [
        "p = X.cdf(2) - X.cdf(1)"
      ],
      "id": "96803a19-521f-46dd-9be3-0647d027fbe9"
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "There’s a p percent chance that someone is infectious between one and\n",
        "two days."
      ],
      "id": "7f457c7d-b22e-45d9-b8f0-7a2c2c8eec14"
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "metadata": {},
      "outputs": [
        {
          "output_type": "display_data",
          "metadata": {},
          "data": {
            "text/plain": [
              "0.25572915991310063"
            ]
          }
        }
      ],
      "source": [
        "1 - X.cdf(1.5)"
      ],
      "id": "b47c31a2-afb5-4b72-8faa-ad96e1e2f74b"
    },
    {
      "cell_type": "code",
      "execution_count": 5,
      "metadata": {},
      "outputs": [
        {
          "output_type": "display_data",
          "metadata": {},
          "data": {
            "text/plain": [
              "2.532843602293451"
            ]
          }
        }
      ],
      "source": [
        "X.ppf(.9)"
      ],
      "id": "695651f1-46a1-4066-a3f5-36e98d45b59d"
    }
  ],
  "nbformat": 4,
  "nbformat_minor": 5,
  "metadata": {
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3 (ipykernel)",
      "language": "python"
    },
    "language_info": {
      "name": "python",
      "codemirror_mode": {
        "name": "ipython",
        "version": "3"
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.12.12"
    }
  }
}