Revision as of 03:13, 9 June 2024 by Bot (Created page with "<div class="d-none"><math> \newcommand{\NA}{{\rm NA}} \newcommand{\mat}[1]{{\bf#1}} \newcommand{\exref}[1]{\ref{##1}} \newcommand{\secstoprocess}{\all} \newcommand{\NA}{{\rm NA}} \newcommand{\mathds}{\mathbb}</math></div> To simulate the Buffon's needle problem we choose independently the distance <math>d</math> and the angle <math>\theta</math> at random, with <math>0 \leq d \leq 1/2</math> and <math>0 \leq \theta \leq \pi/2</math>, and check whether <math>d \leq...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
BBy Bot
Jun 09'24

Exercise

[math] \newcommand{\NA}{{\rm NA}} \newcommand{\mat}[1]{{\bf#1}} \newcommand{\exref}[1]{\ref{##1}} \newcommand{\secstoprocess}{\all} \newcommand{\NA}{{\rm NA}} \newcommand{\mathds}{\mathbb}[/math]

To simulate the Buffon's needle problem we choose

independently the distance [math]d[/math] and the angle [math]\theta[/math] at random, with [math]0 \leq d \leq 1/2[/math] and [math]0 \leq \theta \leq \pi/2[/math], and check whether [math]d \leq (1/2)\sin\theta[/math]. Doing this a large number of times, we estimate [math]\pi[/math] as [math]2/a[/math], where [math]a[/math] is the fraction of the times that [math]d \leq (1/2)\sin\theta[/math]. Write a program to estimate [math]\pi[/math] by this method. Run your program several times for each of 100, 1000, and 10,00 experiments. Does the accuracy of the experimental approximation for [math]\pi[/math] improve as the number of experiments increases?