Skip to content

Commit

Permalink
Solved 3 from handin 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
LilianBittar committed Apr 29, 2023
1 parent c40f813 commit d2f8f88
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions session02/Handin-1.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from scipy.stats import binom\n",
"from scipy.stats import geom\n",
"from scipy.stats import hypergeom\n",
"from scipy.stats import poisson\n",
"from scipy.stats import nbinom\n",
"from scipy.stats import uniform\n",
"import pandas as pd\n",
"import sympy as sp\n",
"from sympy import *\n",
"sp.init_printing()\n",
"import matplotlib.pyplot as plt\n",
"import scipy.integrate as integrate\n",
"import scipy.special as special\n",
"from scipy.integrate import quad\n",
"import numpy as np\n",
"from scipy.misc import derivative\n",
"import math\n",
"from math import *\n",
"from fractions import Fraction\n",
"import fractions\n",
"from IPython.display import display, Math, Latex\n",
"%matplotlib inline\n",
"from IPython.display import Image, HTML"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.3\n",
"0.4\n"
]
}
],
"source": [
"#section 3\n",
"\n",
"result = uniform.cdf(5, 0, 10) - uniform.cdf(2, 0, 10)\n",
"print(result)\n",
"\n",
"# P(X <= 2 given X =< 5 )\n",
"result1 = uniform.cdf(2, 0, 10) / uniform.cdf(5, 0, 10)\n",
"print(result1)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"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.10.9"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit d2f8f88

Please sign in to comment.