Skip to content

prob140/textbook

Repository files navigation

<!DOCTYPE html>


<html lang="en" data-content_root="./" >

  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>Data 140 Textbook &#8212; Data 140 Textbook</title>
  
  
  
  <script data-cfasync="false">
    document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
    document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
  </script>
  
  <!-- Loaded before other Sphinx assets -->
  <link href="_static/styles/theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="_static/styles/bootstrap.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="_static/styles/pydata-sphinx-theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />

  
  <link href="_static/vendor/fontawesome/6.5.2/css/all.min.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
  <link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.5.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.5.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.5.2/webfonts/fa-regular-400.woff2" />

    <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="_static/styles/sphinx-book-theme.css?v=a3416100" />
    <link rel="stylesheet" type="text/css" href="_static/togglebutton.css?v=13237357" />
    <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
    <link rel="stylesheet" type="text/css" href="_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css?v=be8a1c11" />
    <link rel="stylesheet" type="text/css" href="_static/sphinx-thebe.css?v=4fa983c6" />
    <link rel="stylesheet" type="text/css" href="_static/sphinx-design.min.css?v=95c83b7e" />
  
  <!-- Pre-loaded scripts that we'll load fully later -->
  <link rel="preload" as="script" href="_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b" />
<link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
  <script src="_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>

    <script src="_static/documentation_options.js?v=9eb32ce0"></script>
    <script src="_static/doctools.js?v=9a2dae69"></script>
    <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="_static/clipboard.min.js?v=a7894cd8"></script>
    <script src="_static/copybutton.js?v=f281be69"></script>
    <script src="_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
    <script>let toggleHintShow = 'Click to show';</script>
    <script>let toggleHintHide = 'Click to hide';</script>
    <script>let toggleOpenOnPrint = 'true';</script>
    <script src="_static/togglebutton.js?v=4a39c7ea"></script>
    <script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
    <script src="_static/design-tabs.js?v=f930bc37"></script>
    <script>const THEBE_JS_URL = "https://unpkg.com/[email protected]/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
    <script async="async" src="_static/sphinx-thebe.js?v=c100c467"></script>
    <script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
    <script>const THEBE_JS_URL = "https://unpkg.com/[email protected]/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
    <script>DOCUMENTATION_OPTIONS.pagename = 'README';</script>
    <link rel="icon" href="_static/favicon.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <meta name="docsearch:language" content="en"/>
  </head>
  
  
  <body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">

  
  
  <div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div>
  
  <div id="pst-scroll-pixel-helper"></div>
  
  <button type="button" class="btn rounded-pill" id="pst-back-to-top">
    <i class="fa-solid fa-arrow-up"></i>Back to top</button>

  
  <input type="checkbox"
          class="sidebar-toggle"
          id="pst-primary-sidebar-checkbox"/>
  <label class="overlay overlay-primary" for="pst-primary-sidebar-checkbox"></label>
  
  <input type="checkbox"
          class="sidebar-toggle"
          id="pst-secondary-sidebar-checkbox"/>
  <label class="overlay overlay-secondary" for="pst-secondary-sidebar-checkbox"></label>
  
  <div class="search-button__wrapper">
    <div class="search-button__overlay"></div>
    <div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
      action="search.html"
      method="get">
  <i class="fa-solid fa-magnifying-glass"></i>
  <input type="search"
         class="form-control"
         name="q"
         id="search-input"
         placeholder="Search this book..."
         aria-label="Search this book..."
         autocomplete="off"
         autocorrect="off"
         autocapitalize="off"
         spellcheck="false"/>
  <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
  </div>

  <div class="pst-async-banner-revealer d-none">
  <aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside>
</div>

  
    <header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
    </header>
  

  <div class="bd-container">
    <div class="bd-container__inner bd-page-width">
      
      
      
        
      
      <div class="bd-sidebar-primary bd-sidebar">
        

  
  <div class="sidebar-header-items sidebar-primary__section">
    
    
    
    
  </div>
  
    <div class="sidebar-primary-items__start sidebar-primary__section">
        <div class="sidebar-primary-item">

  
    
  

<a class="navbar-brand logo" href="content/README.html">
  
  
  
  
  
    
    
      
    
    
    <img src="_static/sp22_ugarte_logo.png" class="logo__image only-light" alt="Data 140 Textbook - Home"/>
    <script>document.write(`<img src="_static/sp22_ugarte_logo.png" class="logo__image only-dark" alt="Data 140 Textbook - Home"/>`);</script>
  
  
</a></div>
        <div class="sidebar-primary-item">

 <script>
 document.write(`
   <button class="btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <i class="fa-solid fa-magnifying-glass"></i>
    <span class="search-button__default-text">Search</span>
    <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
   </button>
 `);
 </script></div>
        <div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
    <div class="bd-toc-item navbar-nav active">
        
        <ul class="nav bd-sidenav bd-sidenav__home-link">
            <li class="toctree-l1">
                <a class="reference internal" href="content/README.html">
                    Data 140
                </a>
            </li>
        </ul>
        <p aria-level="2" class="caption" role="heading"><span class="caption-text">Introduction</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference external" href="http://prob140.org">Course Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="content/To_the_Student.html">To the  Student</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Chapters</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_01/00_Fundamentals.html">1. Fundamentals</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_01/01_Outcome_Space_and_Events.html">1.1. Outcome Space and Events</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_01/02_Equally_Likely_Outcomes.html">1.2. Equally Likely Outcomes</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_01/03_Collisions_in_Hashing.html">1.3. Collisions in Hashing</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_01/04_Birthday_Problem.html">1.4. The Birthday Problem</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_01/05_An_Exponential_Approximation.html">1.5. An Exponential Approximation</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_01/06_Exercises.html">1.6. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_02/00_Calculating_Chances.html">2. Calculating Chances</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_02/01_Addition.html">2.1. Addition</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_02/02_Examples.html">2.2. Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_02/03_Multiplication.html">2.3. Multiplication</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_02/04_More_Examples.html">2.4. More Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_02/05_Updating_Probabilities.html">2.5. Updating Probabilities</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_02/06_Exercises.html">2.6. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_03/00_Random_Variables.html">3. Random Variables</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_03/01_Functions_on_an_Outcome_Space.html">3.1. Functions on an Outcome Space</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_03/02_Distributions.html">3.2. Distributions</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_03/03_Equality.html">3.3. Equality</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_03/04_Exercises.html">3.4. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_04/00_Relations_Between_Variables.html">4. Relations Between Variables</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_04/01_Joint_Distributions.html">4.1. Joint Distributions</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_04/02_Examples.html">4.2. Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_04/03_Marginal_Distributions.html">4.3. Marginal Distributions</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_04/04_Conditional_Distributions.html">4.4. Conditional Distributions</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_04/05_Dependence_and_Independence.html">4.5. Dependence and Independence</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_04/06_Exercises.html">4.6. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_05/00_Collections_of_Events.html">5. Collections of Events</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_05/01_Bounding_the_Chance_of_a_Union.html">5.1. Bounding the Chance of a Union</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_05/02_Inclusion_Exclusion.html">5.2. Inclusion-Exclusion</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_05/03_The_Matching_Problem.html">5.3. The Matching Problem</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_05/04_Sampling_Without_Replacement.html">5.4. Sampling Without Replacement</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_05/05_Exercises.html">5.5. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_06/00_Random_Counts.html">6. Random Counts</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_06/01_Binomial_Distribution.html">6.1. The Binomial Distribution</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_06/02_Examples.html">6.2. Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_06/03_Multinomial_Distribution.html">6.3. Multinomial Distribution</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_06/04_The_Hypergeometric_Revisited.html">6.4. The Hypergeometric, Revisited</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_06/05_Odds_Ratios.html">6.5. Odds Ratios</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_06/06_Law_of_Small_Numbers.html">6.6. The Law of Small Numbers</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_06/07_Exercises.html">6.7. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_07/00_Poissonization.html">7. Poissonization</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_07/01_Poisson_Distribution.html">7.1. Poisson Distribution</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_07/02_Poissonizing_the_Binomial.html">7.2. Poissonizing the Binomial</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_07/03_Poissonizing_the_Multinomial.html">7.3. Poissonizing the Multinomial</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_07/04_Exercises.html">7.4. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_08/00_Expectation.html">8. Expectation</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_08/01_Definition.html">8.1. Definition</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_08/02_Applying_the_Definition.html">8.2. Applying the Definition</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_08/03_Expectations_of_Functions.html">8.3. Expectations of Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_08/04_Additivity.html">8.4. Additivity</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_08/05_Method_of_Indicators.html">8.5. Method of Indicators</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_08/06_Exercises.html">8.6. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_09/00_Conditioning_Revisited.html">9. Conditioning, Revisited</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_09/01_Probability_by_Conditioning.html">9.1. Probability by Conditioning</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_09/02_Expectation_by_Conditioning.html">9.2. Expectation by Conditioning</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_09/03_Expected_Waiting_Times.html">9.3. Expected Waiting Times</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_09/04_Exercises.html">9.4. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_10/00_Markov_Chains.html">10. Markov Chains</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_10/01_Transitions.html">10.1. Transitions</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_10/02_Deconstructing_Chains.html">10.2. Deconstructing Chains</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_10/03_Long_Run_Behavior.html">10.3. Long Run Behavior</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_10/04_Examples.html">10.4. Examples</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_11/00_Markov_Chain_Monte_Carlo.html">11. Markov Chain Monte Carlo</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_11/01_Balance_and_Detailed_Balance.html">11.1. Balance and Detailed Balance</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_11/02_Code_Breaking.html">11.2. Code Breaking</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_11/03_Metropolis_Algorithm.html">11.3. Metropolis Algorithm</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_11/04_Exercises.html">11.4. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_12/00_Standard_Deviation.html">12. Standard Deviation</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_12/01_Definition.html">12.1. Definition</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_12/02_Prediction_and_Estimation.html">12.2. Prediction and Estimation</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_12/03_Bounds.html">12.3. Tail Bounds</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_12/04_Heavy_Tails.html">12.4. Heavy Tails</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_12/05_Exercises.html">12.5. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_13/00_Variance_Via_Covariance.html">13. Variance Via Covariance</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_13/01_Covariance.html">13.1. Covariance</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_13/02_Properties_of_Covariance.html">13.2. Properties of Covariance</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_13/03_Sums_of_Independent_Variables.html">13.3. Sums of Independent Variables</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_13/04_Symmetry_and_Indicators.html">13.4. Symmetry and Indicators</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_13/05_Finite_Population_Correction.html">13.5. Finite Population Correction</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_13/06_Exercises.html">13.6. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_14/00_The_Central_Limit_Theorem.html">14. The Central Limit Theorem</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_14/01_Exact_Distribution_of_a_Sum.html">14.1. Exact Distribution of a Sum</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_14/02_PGFs_in_NumPy.html">14.2. PGFs in NumPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_14/03_Central_Limit_Theorem.html">14.3. Central Limit Theorem</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_14/04_SciPy_and_Normal_Curves.html">14.4. SciPy and Normal Curves</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_14/05_The_Sample_Mean.html">14.5. The Sample Mean</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_14/06_Confidence_Intervals.html">14.6. Confidence Intervals</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_14/07_Exercises.html">14.7. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_15/00_Continuous_Distributions.html">15. Continuous Distributions</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_15/01_Density_and_CDF.html">15.1. Density and CDF</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_15/02_The_Meaning_of_Density.html">15.2. The Meaning of Density</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_15/03_Expectation.html">15.3. Expectation</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_15/04_Exponential_Distribution.html">15.4. Exponential Distribution</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_15/05_Calculus_in_SymPy.html">15.5. Calculus in SymPy</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_15/06_Exercises.html">15.6. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_16/00_Transformations.html">16. Transformations</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_16/01_Linear_Transformations.html">16.1. Linear Transformations</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_16/02_Monotone_Functions.html">16.2. Monotone Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_16/03_Simulation_via_the_CDF.html">16.3. Simulation via the CDF</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_16/04_Two_to_One_Functions.html">16.4. Two-to-One Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_16/05_Exercises.html">16.5. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_17/00_Joint_Densities.html">17. Joint Densities</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_17/01_Probabilities_and_Expectations.html">17.1. Probabilities and Expectations</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_17/02_Independence.html">17.2. Independence</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_17/03_Marginal_and_Conditional_Densities.html">17.3. Marginal and Conditional Densities</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_17/04_Beta_Densities_with_Integer_Parameters.html">17.4. Beta Densities with Integer Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_17/05_Exercises.html">17.5. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_18/00_The_Normal_and_Gamma_Families.html">18. The Normal and Gamma Families</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_18/01_Standard_Normal_Basics.html">18.1. Standard Normal: The Basics</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_18/02_Sums_of_Independent_Normal_Variables.html">18.2. Sums of Independent Normal Variables</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_18/03_The_Gamma_Family.html">18.3. The Gamma Family</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_18/04_Chi_Squared_Distributions.html">18.4. Chi-Squared Distributions</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_18/05_Exercises.html">18.5. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_19/00_Distributions_of_Sums.html">19. Distributions of Sums</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_19/01_Convolution_Formula.html">19.1. The Convolution Formula</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_19/02_Moment_Generating_Functions.html">19.2. Moment Generating Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_19/03_MGFs_Normal_and_the_CLT.html">19.3. MGFs, the Normal, and the CLT</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_19/04_Chernoff_Bound.html">19.4. Chernoff Bound</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_19/05_Exercises.html">19.5. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_20/00_Approaches_to_Estimation.html">20. Approaches to Estimation</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_20/01_Maximum_Likelihood.html">20.1. Maximum Likelihood</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_20/02_Independence_Revisited.html">20.2. Independence, Revisited</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_20/03_Prior_and_Posterior.html">20.3. Prior and Posterior</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_20/04_Exercises.html">20.4. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_21/00_The_Beta_and_the_Binomial.html">21. The Beta and the Binomial</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_21/01_Updating_and_Prediction.html">21.1. Updating and Prediction</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_21/02_Beta_Binomial_Distribution.html">21.2. The Beta-Binomial Distribution</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_21/03_Long_Run_Proportion_of_Heads.html">21.3. Long Run Proportion of Heads</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_21/04_Exercises.html">21.4. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_22/00_Prediction.html">22. Prediction</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_22/01_Conditional_Expectation_Projection.html">22.1. Conditional Expectation As a Projection</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_22/02_Least_Squares_Predictor.html">22.2. Least Squares Predictor</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_22/03_Variance_by_Conditioning.html">22.3. Variance by Conditioning</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_22/04_Examples.html">22.4. Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_22/05_Exercises.html">22.5. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_23/00_Multivariate_Normal_RVs.html">23. Jointly Normal Random Variables</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_23/01_Random_Vectors.html">23.1. Random Vectors</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_23/02_Multivariate_Normal_Vectors.html">23.2. Multivariate Normal Vectors</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_23/03_Multivariate_Normal_Density.html">23.3. Multivariate Normal Density</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_23/04_Independence.html">23.4. Independence</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_23/05_Exercises.html">23.5. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_24/00_Simple_Linear_Regression.html">24. Simple Linear Regression</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_24/01_Linear_Least_Squares.html">24.1. Least Squares Linear Predictor</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_24/02_Bivariate_Normal_Distribution.html">24.2. Bivariate Normal Distribution</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_24/03_Regression_and_Bivariate_Normal.html">24.3. Regression and the Bivariate Normal</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_24/04_Regression_Equation.html">24.4. The Regression Equation</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_24/05_Exercises.html">24.5. Exercises</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="content/Chapter_25/00_Multiple_Regression.html">25. Multiple Regression</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_25/01_Bilinearity_in_Matrix_Notation.html">25.1. Bilinearity in Matrix Notation</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_25/02_Best_Linear_Predictor.html">25.2. Best Linear Predictor</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_25/03_Multivariate_Normal_Conditioning.html">25.3. Conditioning and the Multivariate Normal</a></li>
<li class="toctree-l2"><a class="reference internal" href="content/Chapter_25/04_Multiple_Regression.html">25.4. Multiple Regression</a></li>
</ul>
</details></li>
</ul>

    </div>
</nav></div>
    </div>
  
  
  <div class="sidebar-primary-items__end sidebar-primary__section">
  </div>
  
  <div id="rtd-footer-container"></div>


      </div>
      
      <main id="main-content" class="bd-main" role="main">
        
        

<div class="sbt-scroll-pixel-helper"></div>

          <div class="bd-content">
            <div class="bd-article-container">
              
              <div class="bd-header-article d-print-none">
<div class="header-article-items header-article__inner">
  
    <div class="header-article-items__start">
      
        <div class="header-article-item"><button class="sidebar-toggle primary-toggle btn btn-sm" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
  <span class="fa-solid fa-bars"></span>
</button></div>
      
    </div>
  
  
    <div class="header-article-items__end">
      
        <div class="header-article-item">

<div class="article-header-buttons">





<div class="dropdown dropdown-download-buttons">
  <button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Download this page">
    <i class="fas fa-download"></i>
  </button>
  <ul class="dropdown-menu">
      
      
      
      <li><a href="_sources/README.md" target="_blank"
   class="btn btn-sm btn-download-source-button dropdown-item"
   title="Download source file"
   data-bs-placement="left" data-bs-toggle="tooltip"
>
  

<span class="btn__icon-container">
  <i class="fas fa-file"></i>
  </span>
<span class="btn__text-container">.md</span>
</a>
</li>
      
      
      
      
      <li>
<button onclick="window.print()"
  class="btn btn-sm btn-download-pdf-button dropdown-item"
  title="Print to PDF"
  data-bs-placement="left" data-bs-toggle="tooltip"
>
  

<span class="btn__icon-container">
  <i class="fas fa-file-pdf"></i>
  </span>
<span class="btn__text-container">.pdf</span>
</button>
</li>
      
  </ul>
</div>




<button onclick="toggleFullScreen()"
  class="btn btn-sm btn-fullscreen-button"
  title="Fullscreen mode"
  data-bs-placement="bottom" data-bs-toggle="tooltip"
>
  

<span class="btn__icon-container">
  <i class="fas fa-expand"></i>
  </span>

</button>



<script>
document.write(`
  <button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light"></i>
    <i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark"></i>
    <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"></i>
  </button>
`);
</script>


<script>
document.write(`
  <button class="btn btn-sm pst-navbar-icon search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <i class="fa-solid fa-magnifying-glass fa-lg"></i>
  </button>
`);
</script>
<button class="sidebar-toggle secondary-toggle btn btn-sm" title="Toggle secondary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <span class="fa-solid fa-list"></span>
</button>
</div></div>
      
    </div>
  
</div>
</div>
              
              

<div id="jb-print-docs-body" class="onlyprint">
    <h1>Data 140 Textbook</h1>
    <!-- Table of contents -->
    <div id="print-main-content">
        <div id="jb-print-toc">
            
            <div>
                <h2> Contents </h2>
            </div>
            <nav aria-label="Page">
                <ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#structure">Structure</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#maintaining-the-textbook">Maintaining the Textbook</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#one-time-setup">One-time Setup</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#updating-the-textbook">Updating the Textbook</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#notes">Notes</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#troubleshooting">Troubleshooting</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#links">Links</a></li>
</ul>
</li>
</ul>
            </nav>
        </div>
    </div>
</div>

              
                
<div id="searchbox"></div>
                <article class="bd-article">
                  
  <section class="tex2jax_ignore mathjax_ignore" id="data-140-textbook">
<h1>Data 140 Textbook<a class="headerlink" href="#data-140-textbook" title="Link to this heading">#</a></h1>
<p>This textbook was built with <a class="reference external" href="https://jupyterbook.org/en/stable/intro.html">Jupyter Books</a>. This README was written by Shahzar.</p>
<section id="structure">
<h2>Structure<a class="headerlink" href="#structure" title="Link to this heading">#</a></h2>
<p>Only three files/directories need to be edited.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">_config.yml</span></code>: Configuration information about the textbook. Modify this file for things like:</p>
<ul>
<li><p>changing the logo or favicon;</p></li>
<li><p>adding or removing launch buttons;</p></li>
<li><p>changing information about the book.</p></li>
</ul>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">_toc.yml</span></code>: Table of contents for the textbook. Modify this file for things like:</p>
<ul>
<li><p>section and chapter numbering and order;</p></li>
<li><p>adding or removing sections or chapters.</p></li>
</ul>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">content/</span></code>: Content of the textbook. All the notebooks with section and chapter content go here. Modify these files to actually change the content of the sections.</p></li>
</ul>
</section>
<section id="maintaining-the-textbook">
<h2>Maintaining the Textbook<a class="headerlink" href="#maintaining-the-textbook" title="Link to this heading">#</a></h2>
<p>This section details how to maintain the textbook.</p>
<section id="one-time-setup">
<h3>One-time Setup<a class="headerlink" href="#one-time-setup" title="Link to this heading">#</a></h3>
<p>Follow these steps the first time you set up a computer to modify and maintain the textbook.</p>
<ol class="arabic simple">
<li><p>Create a local copy of this repo by running <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">clone</span> <span class="pre">https://github.com/prob140/textbook.git</span></code> from the command line in whichever folder you want to contain the textbook.</p></li>
<li><p>Next, you need to install all the required packages. Either of the commands <code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">-r</span> <span class="pre">requirements.txt</span></code> or <code class="docutils literal notranslate"><span class="pre">conda</span> <span class="pre">install</span> <span class="pre">--file</span> <span class="pre">requirements.txt</span></code> should work. If you have a Windows device, it’s preferable to run this in an Anaconda Prompt terminal. This should install the two packages <code class="docutils literal notranslate"><span class="pre">jupyter-book</span></code> and <code class="docutils literal notranslate"><span class="pre">ghp-import</span></code>, which are used for building and deploying the textbook, respectively, and a bunch of other typical packages (e.g. <code class="docutils literal notranslate"><span class="pre">numpy</span></code>, <code class="docutils literal notranslate"><span class="pre">scipy</span></code>, <code class="docutils literal notranslate"><span class="pre">matplotlib</span></code>, etc.) used by the <code class="docutils literal notranslate"><span class="pre">content/</span></code> notebooks.</p></li>
</ol>
</section>
<section id="updating-the-textbook">
<h3>Updating the Textbook<a class="headerlink" href="#updating-the-textbook" title="Link to this heading">#</a></h3>
<p>These steps detail the process you should go through every time you update the textbook.</p>
<ol class="arabic simple">
<li><p><strong>Pull:</strong> <code class="docutils literal notranslate"><span class="pre">cd</span></code> into <code class="docutils literal notranslate"><span class="pre">textbook/</span></code>, your local copy of the textbook repo and <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">pull</span> <span class="pre">origin</span> <span class="pre">master</span></code> to collect any updates which may have been pushed to the remote copy by other collaborators.</p></li>
<li><p><strong>Update:</strong> Make any changes you wish to make. This should (likely) only consist of changes to <code class="docutils literal notranslate"><span class="pre">_config.yml</span></code>, <code class="docutils literal notranslate"><span class="pre">_toc.yml</span></code>, and the files in <code class="docutils literal notranslate"><span class="pre">content/</span></code>.</p>
<ul class="simple">
<li><p>If you added new sections or chapters, update <code class="docutils literal notranslate"><span class="pre">_toc.yml</span></code> as well to reflect your changes.</p></li>
</ul>
</li>
<li><p><strong>Build:</strong> <code class="docutils literal notranslate"><span class="pre">cd</span></code> into the directory above <code class="docutils literal notranslate"><span class="pre">textbook/</span></code> (i.e. <code class="docutils literal notranslate"><span class="pre">cd</span> <span class="pre">..</span></code>) and run <code class="docutils literal notranslate"><span class="pre">jupyter-book</span> <span class="pre">build</span> <span class="pre">textbook</span></code>.</p></li>
<li><p><strong>Check:</strong> Open the file <code class="docutils literal notranslate"><span class="pre">textbook/_build/html/index.html</span></code> in your browser to view what the textbook will look like with any changes you’ve made. Make sure nothing is broken and the changes are as you want them.</p>
<ul class="simple">
<li><p>See the <a class="reference internal" href="#troubleshooting"><span class="xref myst">Troubleshooting</span></a> section for any issues you may be having.</p></li>
<li><p>Take a look at the <a class="reference internal" href="#issues"><span class="xref myst">Issues</span></a> for problematic parts of the textbook.</p></li>
</ul>
</li>
<li><p><strong>Deploy:</strong> <code class="docutils literal notranslate"><span class="pre">cd</span></code> back into <code class="docutils literal notranslate"><span class="pre">textbook/</span></code> (<code class="docutils literal notranslate"><span class="pre">cd</span> <span class="pre">textbook/</span></code>) and run <code class="docutils literal notranslate"><span class="pre">ghp-import</span> <span class="pre">-n</span> <span class="pre">-p</span> <span class="pre">-f</span> <span class="pre">_build/html</span></code> (the <code class="docutils literal notranslate"><span class="pre">-n</span></code> flag is important, since it adds a <code class="docutils literal notranslate"><span class="pre">.nojekyll</span></code> file which allows GitHub to build the website correctly). This will push the <code class="docutils literal notranslate"><span class="pre">_build/html</span></code> folder to the <code class="docutils literal notranslate"><span class="pre">gh-pages</span></code> branch of the textbook repository, which is configured by GitHub Pages to hold the files for the textbook website. To edit these configurations, from the repository page, go to Settings &gt; Pages.</p></li>
<li><p><strong>Push:</strong>  Stage any changes you made (i.e. using <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">add</span> <span class="pre">[file]</span></code>, <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">add</span> <span class="pre">-u</span></code>, <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">add</span> <span class="pre">.</span></code>, etc.), commit your changes with <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">commit</span> <span class="pre">-m</span> <span class="pre">&quot;[description]&quot;</span></code> (please include a useful description of any changes you made), and push to the master repository with <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">push</span> <span class="pre">origin</span> <span class="pre">master</span></code>.</p></li>
</ol>
</section>
</section>
<section id="notes">
<h2>Notes<a class="headerlink" href="#notes" title="Link to this heading">#</a></h2>
<section id="troubleshooting">
<h3>Troubleshooting<a class="headerlink" href="#troubleshooting" title="Link to this heading">#</a></h3>
<p>The (Jupyter Book)(<a class="reference external" href="https://jupyterbook.org/en/stable/intro.html">https://jupyterbook.org/en/stable/intro.html</a>) website has lots of information about Jupyter Book. Some useful pages are:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://jupyterbook.org/en/stable/start/create.html#anatomy-of-a-jupyter-book">Anatomy of a Jupyter Book</a></p></li>
<li><p><a class="reference external" href="https://jupyterbook.org/en/stable/structure/configure.html">Table of Contents</a></p></li>
<li><p><a class="reference external" href="https://jupyterbook.org/en/stable/customize/config.html">Configuration Reference</a></p></li>
<li><p><a class="reference external" href="https://jupyterbook.org/en/stable/content/references.html">References and Cross-References</a></p></li>
<li><p><a class="reference external" href="https://jupyterbook.org/en/stable/start/build.html">Building</a></p></li>
<li><p><a class="reference external" href="https://jupyterbook.org/en/stable/publish/gh-pages.html">Deploying</a></p></li>
</ul>
<p>If changes you’ve made aren’t showing up the HTML after building, sometimes deleting <code class="docutils literal notranslate"><span class="pre">_build</span></code> and then building again helps. Jupyter Book will usually only re-build the HTML of notebooks that it thinks have been changed by any edits made, and so this sometimes means that some changes will go unnoticed. Deleting the entire folder and rebuilding forces it to build from scratch, which prevents any old files or code from sticking around.</p>
</section>
<section id="links">
<h3>Links<a class="headerlink" href="#links" title="Link to this heading">#</a></h3>
<p>Links to the internet should be done as they are usually done in Markdown. However, to cross-link to other pages of the textbook, there is an internal linking system that should be used instead (since it is robust to file structure changes in <code class="docutils literal notranslate"><span class="pre">/textbook</span></code>). This system is described <a class="reference external" href="https://jupyterbook.org/en/stable/content/references.html#reference-section-labels">here</a>.</p>
<p>For example, Section 12.4 Exercise 3 of the <a class="reference internal" href="#stat88.org/textbook"><span class="xref myst">Stat 88 Textbook</span></a> contains a link to Section 12.2.</p>
<ol class="arabic simple">
<li><p>The flag <code class="docutils literal notranslate"><span class="pre">(ch12.2)=</span></code> was added <em>before</em> the primary header of the notebook.</p></li>
</ol>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">(</span><span class="n">ch12</span><span class="mf">.2</span><span class="p">)</span><span class="o">=</span>
<span class="c1">## The Distribution of the Estimated Slope ##</span>
</pre></div>
</div>
<ol class="arabic simple" start="2">
<li><p>The link to Section 12.2 was changed to <code class="docutils literal notranslate"><span class="pre">(ch12.2)</span></code>.</p></li>
</ol>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">**</span><span class="mf">3.</span><span class="o">**</span> 
<span class="n">Refer</span> <span class="n">to</span> <span class="n">the</span> <span class="n">regression</span> <span class="n">of</span> <span class="n">active</span> <span class="n">pulse</span> <span class="n">rate</span> <span class="n">on</span> <span class="n">resting</span> <span class="n">pulse</span> <span class="n">rate</span> <span class="ow">in</span> <span class="p">[</span><span class="n">Section</span> <span class="mf">12.2</span><span class="p">](</span><span class="n">ch12</span><span class="mf">.2</span><span class="p">)</span><span class="o">.</span> <span class="n">Here</span> <span class="n">are</span> <span class="n">the</span> <span class="n">estimated</span> <span class="n">values</span> <span class="n">again</span><span class="p">,</span> <span class="n">along</span> <span class="k">with</span> <span class="n">some</span> <span class="n">additional</span> <span class="n">data</span><span class="o">.</span>
</pre></div>
</div>
<p>Currently, the Data 140 textbook doesn’t use this system for cross-linking, but it should eventually be adapted, as it is more robust to modifications to the file structure.</p>
</section>
</section>
</section>

    <script type="text/x-thebe-config">
    {
        requestKernel: true,
        binderOptions: {
            repo: "binder-examples/jupyter-stacks-datascience",
            ref: "master",
        },
        codeMirrorConfig: {
            theme: "abcdef",
            mode: "python"
        },
        kernelOptions: {
            name: "python3",
            path: "./."
        },
        predefinedOutput: true
    }
    </script>
    <script>kernelName = 'python3'</script>

                </article>
              

              
              
              
              
                <footer class="prev-next-footer d-print-none">
                  
<div class="prev-next-area">
</div>
                </footer>
              
            </div>
            
            
              
                <div class="bd-sidebar-secondary bd-toc"><div class="sidebar-secondary-items sidebar-secondary__inner">


  <div class="sidebar-secondary-item">
  <div class="page-toc tocsection onthispage">
    <i class="fa-solid fa-list"></i> Contents
  </div>
  <nav class="bd-toc-nav page-toc">
    <ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#structure">Structure</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#maintaining-the-textbook">Maintaining the Textbook</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#one-time-setup">One-time Setup</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#updating-the-textbook">Updating the Textbook</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#notes">Notes</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#troubleshooting">Troubleshooting</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#links">Links</a></li>
</ul>
</li>
</ul>
  </nav></div>

</div></div>
              
            
          </div>
          <footer class="bd-footer-content">
            
<div class="bd-footer-content__inner container">
  
  <div class="footer-item">
    
<p class="component-author">
By Ani Adhikari
</p>

  </div>
  
  <div class="footer-item">
    

  <p class="copyright">
    
      © Copyright 2023.
      <br/>
    
  </p>

  </div>
  
  <div class="footer-item">
    
  </div>
  
  <div class="footer-item">
    
  </div>
  
</div>
          </footer>
        

      </main>
    </div>
  </div>
  
  <!-- Scripts loaded after <body> so the DOM is not blocked -->
  <script src="_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b"></script>

  <footer class="bd-footer">
  </footer>
  </body>
</html>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published