{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "# Comparing 2 sets of samples from Gaussians\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 18388 characters]",
      "text/plain": [
       "<Figure size 600x400 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# Generates 2 sets of observations\n",
    "rng = np.random.default_rng(27446968)\n",
    "samples1 = rng.normal(0, size=1000)\n",
    "samples2 = rng.normal(1, size=1000)\n",
    "\n",
    "# Compute a histogram of the sample\n",
    "bins = np.linspace(-4, 4, 30)\n",
    "histogram1, bins = np.histogram(samples1, bins=bins, density=True)\n",
    "histogram2, bins = np.histogram(samples2, bins=bins, density=True)\n",
    "\n",
    "plt.figure(figsize=(6, 4))\n",
    "plt.hist(samples1, bins=bins, density=True, label=\"Samples 1\")  # type: ignore[arg-type]\n",
    "plt.hist(samples2, bins=bins, density=True, label=\"Samples 2\")  # type: ignore[arg-type]\n",
    "plt.legend(loc=\"best\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
