Skip to content

Commit

Permalink
Update lab_08_pi.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
field119 committed Jul 30, 2023
1 parent 4a8ba60 commit 7bbb0d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions book/labs/4_rng/lab_08/lab_08_pi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,19 @@
"## <span style=\"color:orange;\"> A Monte Carlo Experiment </span>\n",
"\n",
"Recall that a uniform random variable $U$ on the interval $(0,1)$ has a probability density function defined as follows:\n",
"\n",
"$$ f_U(u) = \\begin{cases}\n",
" 1 &, 0<u<1 \\\\\n",
" 0 &, \\text{ otherwise}\n",
" 1 , &0<u<1 \\\\\n",
" 0 , &\\text{ otherwise}\n",
"\\end{cases} $$\n",
"\n",
"So the probability $U$ takes a value in a subinterval $(s,t)$ of $(0,1)$ is exactly the length $t-s$ of the subinterval.\n",
"\n",
"More genrerally, a uniform random variable $V$ on the interval $(a,b)$ has probability density function \n",
"\n",
"$$ f_V(v) = \\begin{cases}\n",
" \\frac{1}{b-a} &, a<v<b \\\\\n",
" 0 &, \\text{ otherwise}\n",
" \\frac{1}{b-a}, &a<v<b \\\\\n",
" 0, &\\text{ otherwise}\n",
"\\end{cases} $$"
]
},
Expand Down

0 comments on commit 7bbb0d1

Please sign in to comment.