Integraalipäivät 2022 -tapahtumalle.
Tätä nopanheittosimulaattoria saa käyttää vapaasti. Simulaattorin teki Juha-Matti Huusko keväällä 2022.
Example. Let us first simulate a coin toss. It is a random process with two possible results, heads or tails (in this case 1 or 2), and both results should have the same probability to appear.
>> result=ceil(2*rand(1,1))
>> result=ceil(2*rand(1,1))
Example. If we replace the coin with a dice, there are six possible results.
>> result=ceil(6*rand(1,1))
If we repeat the experiment several times, we can use a histogram to indicate how many times each result is obtained.
>> N=1;result=ceil(6*rand(N,1));hist(result,[1:6])
>> N=10;result=ceil(6*rand(N,1));hist(result,[1:6])
>> N=100;result=ceil(6*rand(N,1));hist(result,[1:6])
>> N=1000;result=ceil(6*rand(N,1));hist(result,[1:6])
>> N=10000;result=ceil(6*rand(N,1));hist(result,[1:6])
>> N=100000;result=ceil(6*rand(N,1));hist(result,[1:6])
As we can notice, when the number of repetitions increases, bars of the histogram become equal. It means that each of the six possible result has the same probability to appear.
Example. In the previous example random process resulted to discrete values. Next we model a continuous-valued random variable that gets random values from interval \([0,1]\).
>> N=100;result=rand(N,1);hist(result,100)
>> N=1e4;result=rand(N,1);hist(result,100)
>> N=1e6;result=rand(N,1);hist(result,100)
The uniform probability (density) distribution of the previous example can be mathematically denoted \begin{equation*} f_x(x)=\begin{cases} 1,\quad 0 \leq x \leq 1\\ 0,\quad \text{elsewhere}. \end{cases} \end{equation*}
As we have learnt from the previous examples, when the number of repetitions increases and bars of the histogram become more narrow, the histogram starts to evolve towards a define shape. Experimental data points can be considered to be a random sample or subset from a hypothetical infinite set of data points called parent population. When the number of measurements approaches infinity, the distribution of the data points approaches a define continuous curve called parent distribution or limiting distribution. Measurements that we make are samples from the parent distribution and they form the sample distribution.
When the number of measurements \(N\) increases, parameters of the sample distribution asymptotically approach parameters of the parent distribution, \begin{equation*} \text{Parent parameter}=\lim_{N \rightarrow \infty}\text{Experimental parameter}. \end{equation*}