tex: add more NFBP graphs

This commit is contained in:
Paul ALNET 2023-06-04 23:26:48 +02:00
parent 2dc8ab1b36
commit 6ceddb79f2
4 changed files with 26 additions and 27 deletions

View file

@ -368,6 +368,6 @@ def basic_demo():
)
stats_NFBP_iter(10**3, 10)
stats_NFBP_iter(10**5, 50)
print("\n\n")
stats_NFDBP(10**3, 10, 1)

View file

@ -243,41 +243,40 @@ is the same as for $ T_i $, yielding $ \overline{V_1} = 0.897 $, $ {S_N}^2 =
the two values for $ V_1 $ are high (being bouded between $ 0 $ and $ 1 $).
\paragraph{1 000 000 simulations} In order to ensure better precision, we then
ran $ R = 10^6 $ simulations with $ N = 50 $ different items each.
\paragraph{100 000 simulations} In order to ensure better precision, we then
ran $ R = 10^5 $ simulations with $ N = 50 $ different items each.
With 10 6 simulations, we obtain Xn barre = cf graphe
Calcul Sn carre
IC observed
\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth]{graphics/graphic-NFBP-Ti-105-sim}
\caption{Histogram of $ T_i $ for $ R = 10^5 $ simulations and $ N = 50 $ items (number of items per bin)}
\label{fig:graphic-NFBP-Ti-105-sim}
\end{figure}
On this graph (figure \ref{fig:graphic-NFBP-Ti-2-sim}), we can see each value
of $ T_i $. Our calculations have yielded that $ \overline{T_1} = 1.72 $ and $
{S_N}^2 = 0.88 $. Our Student coefficient is $ t_{0.95, 2} = 2 $.
Same for V.
We can now calculate the Confidence Interval for $ T_1 $ for $ R = 10^5 $ simulations :
\begin{align*}
IC_{95\%}(T_1) & = \left[ 1.72 \pm 1.96 \frac{\sqrt{0.88}}{\sqrt{10^5}} \cdot 2 \right] \\
& = \left[ 172 \pm 0.012 \right] \\
\end{align*}
Graphe H
We can see that the Confidence Interval is very small, thanks to the large number of iterations.
This results in a steady curve in figure \ref{fig:graphic-NFBP-Ti-105-sim}.
\paragraph{Distribution of $ T_i $} We first studied how many items were
present per bin.
% TODO sim of T_i
We determined the empirical mean to be
\[
\overline{T_i} = \frac{1}{20} \sum_{k=1}^{20} T_k = 1.5 \qquad \forall 1 \leq i \leq 20
\]
We can show
\paragraph{Distribution of $ V_i $} We then looked at the size of the first
item in each bin.
\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth]{graphics/graphic-NFBP-Vi-105-sim}
\caption{Histogram of $ V_i $ for $ R = 10^5 $ simulations and $ N = 50 $ items (size of the first item in a bin)}
\label{fig:graphic-NFBP-Vi-105-sim}
\end{figure}
\paragraph{Asymptotic behavior of $ H_n $} Finally, we analyzed how many bins
were needed to store $ n $ items.
were needed to store $ n $ items. We used the numbers from the $ R = 10^5 $ simulations.
% TODO histograms
% TODO analysis histograms

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB