by Barbara Mongelli
Master Degree in CyberSecurity University of Sapienza, Rome
What is statistics and why is it useful?
Statistics is the science concerned with developing and studying methods for collecting, analyzing, interpreting and presenting empirical data. Statistics is a highly interdisciplinary field; research in statistics finds applicability in virtually all scientific fields and research questions in the various scientific fields motivate the development of new statistical methods and theory. In developing methods and studying the theory that underlies the methods statisticians draw on a variety of mathematical and computational tools.
Research #1
Concept of data set obtained by a population of statistical units and attributes
In statistics, a population is a set of similar items or events which is of interest for some question or experiment. A statistical population can be a group of existing objects or a hypothetical and potentially infinite group of objects conceived as a generalization from experience. A common aim of statistical analysis is to produce information about some chosen population.
A unit is one member of a set of entities being studied. It is the main source for the mathematical abstraction of a “random variable”. Common examples of a unit would be a single person, animal, plant, manufactured item, or country that belongs to a larger collection of such entities being studied.
Units are often referred to as being either experimental units, sampling units or units of observation:
- An “experimental unit” is typically thought of as one member of a set of objects that are initially equal, with each object then subjected to one of several experimental treatments. Put simply, it is the smallest entity to which a treatment is applied.
- A “sampling unit” is typically thought of as an object that has been sampled from a statistical population. This term is commonly used in opinion pulling and survey sampling.
The properties that are being examined are called attributes, their answers are variables (=values).
Research #2
Deepening scale of measurement
In statistics, depending on the kind of data we ascertained, we use different kinds of scales. Not every attribute or variable can be translated to numerical values in the same way. While body size can easily be depicted in centimeters or in feet and inches, this is not possible for variables such as gender and possible but difficult for levels of personal satisfaction.
The level of measurement expresses, how quantifiable a value actually is, i.e. to what extend we can apply mathematical operations. We differ four levels of measurement:
- nominal scale (non-metric or categorical)
- ordinal scale (non-metric or categorical)
- interval scale (metric)
- ratio scale (metric)
Research #3
From data set to distribution
The distribution of a statistical data set (or a population) is a listing or function showing all the possible values (or intervals) of the data and how often they occur. When a distribution of categorical data is organized, you see the number or percentage of individuals in each group. When a distribution of numerical data is organized, they’re often ordered from smallest to largest, broken into reasonably sized groups (if appropriate), and then put into graphs and charts to examine the shape, center, and amount of variability in the data.
Research #4
Relative frequency and formal properties
A frequency distribution shows the number of elements in a data set that belong to each class. In a relative frequency distribution, the value assigned to each class is the proportion of the total data set that belongs in the class.
To compute relative frequency, we use:
Relative frequency = Class count / Total count
The above equation expresses relative frequency as a proportion. It is also often expressed as a percentage. Thus, a relative frequency of 0.50 is equivalent to a percentage of 50%.
Research #5
Quantitative, continuous, categorical datas and representations
Quantitative data is defined as the value of data in the form of counts or numbers where each data-set has an unique numerical value associated with it. This data is any quantifiable information that can be used for mathematical calculations and statistical analysis, such that real-life decisions can be made based on these mathematical derivations. This type of data could be represented in many ways such as bar graph, histograms, pie charts and so on.
Continuous data are informations that can be measured on a continuum or scale. Continuous data can have almost any numeric value and can be meaningfully subdivided into finer and finer increments, depending upon the precision of the measurement system.
As opposed to discrete data like good or bad, off or on, etc., continuous data can be recorded at many different points (length, size, width, time, temperature, cost, etc.). Continuous data is data that can be measured and broken down into smaller parts and still have meaning. This type of data can be measured into a scale.
Categorical variables represent types of data which may be divided into groups. Examples of categorical variables are race, sex, age group, and educational level. While the latter two variables may also be considered in a numerical manner by using exact values for age and highest grade completed, it is often more informative to categorize such variables into a relatively small number of groups. Analysis of categorical data generally involves the use of data tables.
Research #6
Most important families of theoretical distributions
CONTINUOUS
- Uniform: the continuous uniform distribution or rectangular distribution is a family of symmetric probability distributions such that for each member of the family, all intervals of the same length on the distribution’s support are equally probable.
- Normal: the normal (or Gaussian or Gauss or Laplace–Gauss) distribution is a very common continuous probability distribution. Normal distributions are important in statistics and are often used in the natural and social sciences to represent real-valued random variables whose distributions are not known. A random variable with a Gaussian distribution is said to be normally distributed and is called a normal deviate.
- χ2: the chi distribution is a continuous probability distribution. It is the distribution of the positive square root of the sum of squares of a set of independent random variables each following a standard normal distribution, or equivalently, the distribution of the Euclidean distance of the random variables from the origin. It is thus related to the chi-squared distribution by describing the distribution of the positive square roots of a variable obeying a chi-squared distribution.
- γ: the gamma distribution is a two-parameter family of continuous probability distributions. The exponential distribution, Erlang distribution, and chi-squared distribution are special cases of the gamma distribution.
- β: the beta distribution is a family of continuous probability distributions defined on the interval [0, 1] parametrized by two positive shape parameters, denoted by α and β, that appear as exponents of the random variable and control the shape of the distribution. It is a special case of the Dirichlet distribution.
- T-student: Student’s t-distribution (or simply the t-distribution) is any member of a family of continuous probability distributions that arises when estimating the mean of a normally distributed population in situations where the sample size is small and the population standard deviation is unknown. It was developed by William Sealy Gosset under the pseudonym Student.
- F Fisher: Fisher’s non central hyper geometric distribution is a generalisation of the hyper geometric distribution where sampling probabilities are modified by weight factors. It can also be defined as the conditional distribution of two or more binomially distributed variables dependent upon their fixed sum.
- Exponential: the exponential distribution is the probability distribution of the time between events in a Poisson point process, i.e., a process in which events occur continuously and independently at a constant average rate. It is a particular case of the gamma distribution. It is the continuous analogue of the geometric distribution, and it has the key property of being memoryless. In addition to being used for the analysis of Poisson point processes it is found in various other contexts.
- Weibull: the Weibull distribution is a continuous probability distribution. It is named after Swedish mathematician Waloddi Weibull […] to describe a particle size distribution.
DISCRETE
- Binomial: the binomial distribution with parameters n and p is the discrete probability distribution of the number of successes in a sequence of n independent experiments, each asking a yes–no question, and each with its own boolean-valued outcome: success/yes/true/one (with probability p) or failure/no/false/zero (with probability q = 1 − p). A single success/failure experiment is also called a Bernoulli trial or Bernoulli experiment and a sequence of outcomes is called a Bernoulli process; for a single trial, i.e., n = 1, the binomial distribution is a Bernoulli distribution. The binomial distribution is the basis for the popular binomial test of statistical significance.
- Multinomial: the multinomial distribution is a generalization of the binomial distribution. For example, it models the probability of counts of each side for rolling a k-sided die n times. For n independent trials each of which leads to a success for exactly one of k categories, with each category having a given fixed success probability, the multinomial distribution gives the probability of any particular combination of numbers of successes for the various categories.
Research #7
Most common data types and collections in Visual Studio (Visual Basic, C#)


Research #8 and #9
Similarities and differences between the concepts of descriptive and inferential statistics
Descriptive Statistics refers to a discipline that quantitatively describes the important characteristics of the data-set. For the purpose of describing properties, it uses measures of central tendency, i.e. mean, median, mode and the measures of dispersion i.e. range, standard deviation, quartile deviation and variance, etc.
The data is summarised by the researcher, in a useful way, with the help of numerical and graphical tools such as charts, tables, and graphs, to represent data in an accurate way. Moreover, the text is presented in support of the diagrams, to explain what they represent.
Inferential Statistics is all about generalising from the sample to the population, i.e. the results of analysis of the sample can be deduced to the larger population, from which the sample is taken. It is a convenient way to draw conclusions about the population when it is not possible to query each and every member of the universe. The sample chosen is a representative of the entire population; therefore, it should contain important features of the population.
Inferential Statistics is used to determine the probability of properties of the population on the basis of the properties of the sample, by employing probability theory. The major inferential statistics are based on the statistical models such as Analysis of Variance, chi-square test, student’s t distribution, regression analysis, etc.
Research #10
Relationship between the concept of “statistic” as function of known data opposing to the concept of “state of nature” or “parameter” in the unknown population
Decision analysis, also called statistical decision theory, involves procedures for choosing optimal decisions in the face of uncertainty. In the simplest situation, a decision maker must choose the best decision from a finite set of alternatives when there are two or more possible future events, called states of nature, that might occur.
The list of possible states of nature includes everything that can happen, and the states of nature are defined so that only one of the states will occur. The outcome resulting from the combination of a decision alternative and a particular state of nature is referred to as the payoff.
When probabilities for the states of nature are available, probabilistic criteria may be used to choose the best decision alternative. The most common approach is to use the probabilities to compute the expected value of each decision alternative. The expected value of a decision alternative is the sum of weighted payoffs for the decision. The weight for a payoff is the probability of the associated state of nature and therefore the probability that the payoff occurs.
For a maximisation problem, the decision alternative with the largest expected value will be chosen; for a minimisation problem, the decision alternative with the smallest expected value will be chosen.
Decision analysis can be extremely helpful in sequential decision-making situations — that is, situations in which a decision is made, an event occurs, another decision is made, another event occurs, and so on. For instance, a company trying to decide whether or not to market a new product might first decide to test the acceptance of the product using a consumer panel. Based on the results of the consumer panel, the company will then decide whether or not to proceed with further test marketing; after analysing the results of the test marketing, company executives will decide whether or not to produce the new product.
A decision tree is a graphical device that is helpful in structuring and analysing such problems. With the aid of decision trees, an optimal decision strategy can be developed. A decision strategy is a contingency plan that recommends the best decision alternative depending on what has happened earlier in the sequential process.
Research #11
Relationship between conditional and marginal frequencies
A conditional distribution shows the probability that a randomly selected item in a sub-population has a characteristic you’re interested in.
For example, if you are studying eye colors (the population) you might want to know how many people have blue eyes (the sub-population).
Conditional distributions are easier to find with the help of a table. Marginal and conditional distributions can be found on the same table. Marginal distributions are the totals for the probabilities. They are found in the margins (that’s why they are called “marginal”).
Research #12
Intuitive definition of the concept of probability
Probability is a statistical concept that measures the likelihood of something happening. Classical probability is the statistical concept that measures the likelihood of something happening, but in a classic sense, it also means that every statistical experiment will contain elements that are equally likely to happen.
Another classical approach to probability is relative frequency, which is the ratio of the occurrence of a singular event and the total number of outcomes. This is a tool that is often used after you collect data. You can compare a single part of the data to the total amount of data collected.
Research #13 and #14
Most useful loop and conditional structures
IF — ELSE
An if statement identifies which statement to run based on the value of a Boolean expression. In the following example, the bool variable condition is set to true and then checked in the if statement. The output is The variable is set to true.
n an if-else statement, if condition evaluates to true, the then-statement runs. If condition is false, the else-statement runs. Because condition can’t be simultaneously true and false, the then-statement and the else-statement of an if-else statement can never both run. After the then-statement or the else-statement runs, control is transferred to the next statement after the if statement.
In an if statement that doesn’t include an else statement, if condition is true, the then-statement runs. If condition is false, control is transferred to the next statement after the if statement.
SWITCH
The Switch function argument list consists of pairs of expressions and values. The expressions are evaluated from left to right, and the value associated with the first expression to evaluate to True is returned.
If the parts aren’t properly paired, a run-time error occurs. For example, if expr-1 is True, Switch returns value-1. If expr-1 is False, but expr-2 is True, Switch returns value-2, and so on.
Switch returns a Null value if:
- None of the expressions is True.
- The first True expression has a corresponding value that is Null.
Switch evaluates all of the expressions, even though it returns only one of them. For this reason, you should watch for undesirable side effects. For example, if the evaluation of any expression results in a division by zero error, an error occurs.
SELECT
If testexpression matches any Case expressionlist clause, the statements following that Case statement run up to the next Case, Case Else, or End Select statement. Control then passes to the statement following End Select. If testexpression matches an expressionlist clause in more than one Case clause, only the statements following the first match run.
The Case Else statement is used to introduce the elsestatements to run if no match is found between the testexpression and an expressionlist clause in any of the other Case statements. Although not required, it is a good idea to have a Case Else statement in your Select Case construction to handle unforeseen testexpression values. If no Case expressionlist clause matches testexpression and there is no Case Else statement, control passes to the statement following End Select.
While Loops
The While…End While construction runs a set of statements as long as the condition specified in the While statement is True. For more information, see While…End While Statement.
Do Loops
The Do…Loop construction allows you to test a condition at either the beginning or the end of a loop structure. You can also specify whether to repeat the loop while the condition remains True or until it becomes True. For more information, see Do…Loop Statement.
For Loops
The For…Next construction performs the loop a set number of times. It uses a loop control variable, also called a counter, to keep track of the repetitions. You specify the starting and ending values for this counter, and you can optionally specify the amount by which it increases from one repetition to the next. For more information, see For…Next Statement.
Research #15 and #16
Some of the most used and famous averages
Geometric Mean
The geometric mean is used to determine average rates of change over a period of time, such as a portfolio return or the return of a stock. To compute, add 1 to each observation, assuming you are calculating the geometric mean of several rates of return. Next, multiply all of these together and take the N root of the product (or take the product and raise it to the (1/N) power). Because you added 1 to each observation, at the end you must subtract 1. The reason that you must add 1 to each percent in the first place is because if a return for one of the periods is 0 or negative, you will not be able to find the N root or raise it to the (1/N) power.

Weighted Mean
Another type of mean that is used often in finance, specifically when analyzing portfolio returns for a given period, is the weighted mean. When calculating the arithmetic mean, all observations are given an equal weight. However, when determining the weighted mean, you ‘assign’ different weights to different observations. To calculate the weighted mean, multiply the weight and the return for each observation, and then add them all together.

Quadratic Mean
The quadratic mean (also called the root mean square) is a type of average. Sometimes the quadratic mean is referred to as being “the same as” the standard deviation. This isn’t strictly true: standard deviation is actually equal to the quadratic deviations from the mean of the data set. For example, quadratic mean is used in the physical sciences as a synonym for standard deviation when referencing the “square root of the mean squared deviation of a signal from a given baseline or fit”(Wolfram). The quadratic mean is also called the root mean square because it is the square root of the mean of the squares of the numbers in the set.
The quadratic mean is equal to the square root of the mean of the squared values. The formula is:

Harmonic Mean
Lastly, the harmonic mean is a type of average that only applies to data sets relating to or characterized by musical harmony (…kidding). The harmonic mean is actually a specialized average that is only appropriate when averaging ratios when the ratios are applied to a fixed quantity. To calculate harmonic mean, divide N by the sum of 1 divided Xi, or each observation. An example of when the harmonic mean would be used is when you need to determine the average price-per-share an investor paid at different times, a strategy known as cost averaging.

Research #17 and #18
The Markov’s inequality
Markov’s inequality is a helpful result in probability that gives information about a probability distribution. The remarkable aspect about it is that the inequality holds for any distribution with positive values, no matter what other features that it has. Markov’s inequality gives an upper bound for the percent of the distribution that is above a particular value.
Markov’s inequality says that for a positive random variable X and any positive real number alpha, the probability that X is greater than or equal to alpha is less than or equal to the expected value of X divided by alpha.
The above description can be stated more succinctly using mathematical notation. In symbols, we write Markov’s inequality as:

If we know more about the distribution that we’re working with, then we can usually improve on Markov’s inequality. The value of using it is that it holds for any distribution with nonnegative values.
Research #19
Probability axioms, union bound, definition of probability and the Bayes Theorem
One strategy in mathematics is to start with a few statements, then build up more mathematics from these statements. The beginning statements are known as axioms. An axiom is typically something that is mathematically self-evident. From a relatively short list of axioms, deductive logic is used to prove other statements, called theorems or propositions.
The area of mathematics known as probability is no different. Probability can be reduced to three axioms. This was first done by the mathematician Andrei Kolmogorov. The handful of axioms that are underlying probability can be used to deduce all sorts of results. But what are these probability axioms?
Definitions and Preliminaries
In order to understand the axioms for probability, we must first discuss some basic definitions. We suppose that we have a set of outcomes called the sample space S. This sample space can be thought of as the universal set for the situation that we are studying. The sample space is comprised of subsets called events E1, E2, . . ., En.
We also assume that there is a way of assigning a probability to any event E. This can be thought of as a function that has a set for an input, and a real number as an output. The probability of the event E is denoted by P(E).
Axiom One
The first axiom of probability is that the probability of any event is a non-negative real number. This means that the smallest that a probability can ever be is zero and that it cannot be infinite. The set of numbers that we may use are real numbers. This refers to both rational numbers, also known as fractions, and irrational numbers that cannot be written as fractions.
One thing to note is that this axiom says nothing about how large the probability of an event can be. The axiom does eliminate the possibility of negative probabilities. It reflects the notion that smallest probability, reserved for impossible events, is zero.
Axiom Two
The second axiom of probability is that the probability of the entire sample space is one. Symbolically we write P(S) = 1. Implicit in this axiom is the notion that the sample space is everything possible for our probability experiment and that there are no events outside of the sample space.
By itself, this axiom does not set an upper limit on the probabilities of events that are not the entire sample space. It does reflect that something with absolute certainty has a probability of 100%.
Axiom Three
The third axiom of probability deals with mutually exclusive events. If E1 and E2 are mutually exclusive, meaning that they have an empty intersection and we use U to denote the union, then:
P(E1 U E2) = P(E1) + P(E2)
The axiom actually covers the situation with several (even countably infinite) events, every pair of which are mutually exclusive. As long as this occurs, the probability of the union of the events is the same as the sum of the probabilities:

Although this third axiom might not appear that useful, we will see that combined with the other two axioms it is quite powerful indeed.
The Union Bound and Extension
The union bound or Boole’s inequality is applicable when you need to show that the probability of union of some events is less than some value.
For any events A1, A2, …, An, we have:

the union bound states that the probability of union of some events is smaller than the first term in the inclusion-exclusion formula. We can in fact extend the union bound to obtain lower and upper bounds on the probability of union of events. These bounds are known as Bonferroni inequalities.
Bayes Theorem
Bayes theorem is a formula that describes how to update the probabilities of hypotheses when given evidence. It follows simply from the axioms of conditional probability, but can be used to powerfully reason about a wide range of problems involving belief updates.
Bayes theorem is stated mathematically as the following equation:
where A and B are events and P(B) ≠ 0.
- P(A∣B) is a conditional probability: the likelihood of event A occurring given that B is true.
- P(B∣A) is also a conditional probability: the likelihood of event B occurring given that A is true.
- P(A) and P(B) are the probabilities of observing A and B independently of each other; this is known as the marginal probability.
Research #20
Streaming algorithm for mean and variance and explain why the Running Mean formula is preferable to the definition formula
In computer science, streaming algorithms are algorithms for processing data streams in which the input is presented as a sequence of items and can be examined in only a few passes (typically just one).
Algorithms for calculating variance
Algorithms for calculating variance play a major role in computational statistics. A key difficulty in the design of good algorithms for this problem is that formulas for the variance may involve sums of squares, which can lead to numerical instability as well as to arithmetic overflow when dealing with large values.
Welford’s online algorithm
It is often useful to be able to compute the variance in a single pass, inspecting each value xi only once; for example, when the data are being collected without enough storage to keep all the values, or when costs of memory access dominate those of computation. For such an online algorithm, a recurrence relation is required between quantities from which the required statistics can be calculated in a numerically stable fashion.
Running Mean
In statistics this type of average is called moving mean or running mean, this calculation is widely used to analyze data by creating a series of averages of different samples of the whole sample (or distribution). Given a series of numbers and samples of a predetermined size, the first element of the running mean is obtained by averaging the sample over a predetermined initial size. Then the initial sample is modified by performing a “shifting forward” operation, then in practice by overwriting the first element of the whole. This type of average is typically used in the historical series. A historical series, is a set of random variables ordered with respect to time, and expresses the dynamics of a certain phenomenon in time.
Research #21
The concept of dispersion and the most “popular” statistics to quantify it
The concept of dispersion
Through the average value it is possible to obtain a synthetic description of a statistical phenomenon, however through this it is not possible to have any information on how the data of the distribution are distributed.
To evaluate this, we either use special indices called dispersion indices.
The extremes are the element with the lowest value and the element with the highest value belonging to the range of the distribution.
The range of variation, or range, is the simplest of the dispersion indices and is calculated by making the difference between the extremes, thus obtaining the amplitude of the data interval.
The absolute distance of all data from the mean, makes the arithmetic mean of these distances. This quantity is called the average deviation.
Variance and standard deviation
Variance is the arithmetic mean of the squares of the data distances from the mean.
The standard deviation is equal to the square root of the variance. These two indices take into account the distribution of all data and provide information about it. In fact, the smaller the variance and standard deviation are, the more concentrated the data are. On the other hand, the larger these indices are, the more scattered the data is.
Research #22
The concept of sampling distribution and particularly the sampling distribution of the 𝞵 and the 𝜎.
The concept of sample distribution, in statistics, is the probability distribution of a given statistic based on the choice of a random sample. If, taken an arbitrarily large set of samples, each of which involves multiple observations, this set is used to calculate one or more values of a statistical data, whether this is for example the mean or the variance, for each sample, then the sample distribution is the probability distribution of the values that make up the statistic.
This type of distributions are of fundamental importance, because they allow to carry out analytical considerations based on the sample distribution without having to use the joint probability distribution of the various distributions involved in the calculation.
Suppose we have a normal population with average 𝞵 and variance 𝜎. Let’s consider repeatedly taking samples of a given size from this population and calculating the sample mean. This is a normal distribution of the type N (𝞵, 𝜎/n) , where n is the sample size, since the population from which it derives is also a normal population.
Research #23
Interpretation and importance of the Bayes Theorem in statistical inference: the concept of prior, posterior probabilities and likelihood
The Bayes theorem is the backbone on which Bayessian inference develops. This is an approach to statistical inference in which probabilities are not interpreted as frequencies, but as levels of confidence in the occurrence of a given event. Bayessian inference represents in a certain way the formalization of the scientific method, its importance lies in this. In fact, when a scientific study is carried out, first of all observations are made to collect data, which support or refute a given hypothesis. In this sense, one cannot be certain about a hypothesis, but a large amount of data is able to demonstrate a certain degree of confidence that a given event occurs or not.
Prior and posterior probability
In Bayessian inference, the prior probability is the probability that an event will occur before new data is collected, which is basically the best probability that can be obtained up to that point, with the current level of knowledge. On the contrary, the posterior probability (or posterior probability) is the probability that an event will occur after all the necessary data has been collected.
The likelihood function
Many probability distributions have parameters that are not always known, so these parameters are estimated using data samples. The probability function, gives an idea of how well these data should be synthesized these parameters.
Research #24
The most interesting statistical charts added in my personal library
Types of Charts
There are several different types of charts and graphs. The three most common are probably bar graphs, histograms and pie charts. They are generally used for, and best for, quite different things.
I would use:
- Bar graphs to show numbers that are independent of each other. Example data might include things like the number of people who preferred each of Chinese takeaways, Indian takeaways and fish and chips.
- Pie charts to show you how a whole is divided into different parts. You might, for example, want to show how a budget had been spent on different items in a particular year.
- A histogram is a specific type of bar chart, where the categories are ranges of numbers. Histograms therefore show combined continuous data.
Research #25
The inversion method to generate random variables
Reverse transform sampling is a method of generating random numbers from any probability distribution, known as its probability distribution function, using its cumulative reverse distribution f^-1(x). This method is sufficiently generic, but may be computationally too onerous in practice for certain probability distributions. A methodology that applies a less generic algorithm but computationally more efficient is the Box-Muller transformation.
The inversion method is based on the fact that if X is a random continuous variable with a strictly increasing distribution function fx and Y = fx(X), then Y has a uniform distribution in the interval [fx_min , fx_max].
The method to apply this inversion is as follows: date X random variable whose distribution can be described by the function of distribution F, The objective is to obtain values of X such that they are distributed according to this function. To achieve this transformation, you have to perform two steps: the first is to generate a uniformly distributed pseudo-random value, called u. The second step is to calculate the value of x such that F(x)=u, this value will be called x. The x is the random number distributed by F.
Research #26
The most common algorithms for Normal Random Variables generation and the Box muller’s Transform
The most commonly used methods for generating normal random variables are the following:
- Box-Muller: this method generates a pair of standard independent random normal variables, using a pair of uniform random numbers.
- Sum of uniform normal variables: the easiest way to generate normal variables is to apply the central limit theorem. The central limit theorem is a weak convergence result that expresses the fact that any sum of many small independent random variables is distributed normally. The use of the central limit theorem on random variables U(0,1) provides a simple method for approximating variables that approach normal random variants. The following algorithm is used to generate the standard normal variables. The algorithm consists of two steps: the first one is to generate n random variables, the second one is to sum up these values and subtract n/2 units from this value.
- Polar Method: this has the advantage of being faster and numerically more robust. Some random numbers are discarded, but the algorithm is faster than the base form because it is less onerous to evaluate numerically, provided that the random number generator is relatively efficient, and typically more robust. In addition, the polar function avoids the use of trigonometric functions that are uncomfortable to compute. The algorithm can be summarized as follows. Two random variables U1 and U2 are generated from the U(0,1) distribution, two variables V1=2*U1^–1 , V2=2*U2^–1 and both S=(V1)²+(V2)² are set. If S>1 is restarted from the beginning, otherwise we continue by returning two variables with the following formula:

Research #27 and #28
The Central Limit Theorem and its importance for the practical applications
The central limit theorem states that if you have a population with mean μ and standard deviation σ and take sufficiently large random samples from the population with replacement (which means that when a unit selected at random from the population, it is returned to the population (replaced), and then a second element is selected at random), then the distribution of the sample means will be approximately normally distributed.
This will hold true regardless of whether the source population is normal or skewed, provided the sample size is sufficiently large (usually n > 30). If the population is normal, then the theorem holds true even for samples smaller than 30. In fact, this also holds true even if the population is binomial, provided that min(np, n(1-p))> 5, where n is the sample size and p is the probability of success in the population. This means that we can use the normal probability model to quantify uncertainty when making inferences about a population mean based on the sample mean.
Research #29
The Čebyšëv Inequality and the proof of the weak law of large numbers
The inequality of Čebyšëv is a corollary of the Markov‘s inequality. Usually this is used mainly in the field of probabilistic theory and less in the field of real data. It states that if a random variable X has expected value 𝞵 and variance 𝜎 and λ is a positive real number, then the probability of X assuming a value between 𝞵 -𝜎λ and 𝞵 +𝜎λ is greater than 1–1/ λ².
The weak law of large numbers
The Weak Law of Large Numbers, also known as Bernoulli’s theorem, states that if you have a sample of independent random variables distributed identically, as the sample size increases, the average sample will tend towards the average population. In mathematical form we can express this law as follows:

This law can be proved by using the inequality of Čebyšëv, which states that the probability of a variable X to differ from its average by a quantity k is less than or at most equal to the variance of X, divided by the square of the constant k. In formula this becomes:

Since X and k can assume any value then we can assume that X assumes as value the average and k assumes value ε, therefore:

By carrying out simplifications, which derive from the fact that we have assumed that the sample contains independent variables and distributed in an identical manner, the formula will come to take the form:

If n tends to infinity, it is easy to see how the value of the second member of inequality tends to 0.
Research #30
