2. Probability.

A property of a physical, biological or social system can generally assume different quantitative or qualitative values.

For example, the sex of a human being can be male or female; the stage of its life can be the childhood, the adolescence, the maturity or the oldness. Sex and stage of life are qualitative properties. Moreover a human being has age and height, both usually expressed by numbers. Age and height are quantitative properties.

The set, that can be discrete or continuous, of all the values that can be assumed by one or more properties of a system is the sample space or, more simply, the sample, S.

Every subset Ex of S is said an event.

A real function p(Ex) such that, given Eqn000.gif,

is said probability function.

For example, the sample space of the outcomes of a roll of a dice is S={1,2,3,4,5,6}.

The events are subset as E1 = {1}, E2 = {2}, E3 = {3}, E4 = {4}, E5 = {5}, E6 = {6}, E12 = {1,2}, E246 = {2,4,6}, etc.

The equality (2.4) gives Eqn006.gif
so, if Eqn007.gif, we have

We have also


If a sample space S is the cartesian product of two other sample spaces Sx and Sy and Eqn012.gif, the symbol Eqn013.gif (the probability of Ey given Ex) represents the probability of the event Eqn014.gif. E is a compound event.

If Eqn015.gif, the events Ex and Ey are said mutually independent, or, more simply, independent; otherwise they are dependent.

If, for example, a box contains three balls, one red, one green and one blue and we draw a ball at random, the probability p(R) to draw a red ball is Eqn016.gif.

If we do two consecutive extractions Ex and Ey, we have a compound event that is different depending on whether after the first extraction of a ball we put or not the ball in the box.

In the first case the sample space is Eqn017.gif.
There are 3 cases out of 9 in which the second ball is red, so Eqn018.gif. Then in this case the probability that the second ball is red is equal to the probability p(Ey)=p(R) of drawing a red ball in a single extraction: the events Ex and Ey are independent.

In the second case the sample space is Eqn019.gif and, as it is obvious, the second ball cannot be red: p(Ey|Ex)=0≠p(Ey).
The events Ex and Ey are dependent.

In general, if Eqn020.gif is a compound event,

In particular:


The birthday problem

What is the probability that in a set of n randomly chosen people, two of them have the same birthday?

Let be p(n) the requested probability. The problem is easier if we first calculate the opposite probability Eqn100.gif. For simplicity's sake we do not consider the leap years and we assume that all dates of birth have equal probability.

For example, the probability that out of 80 people, there are 2 with the same birthday is Eqn106.gif: it is virtually certain that two people have the same birthday.

We could achieve the same result by using combinatorial methods. In fact, q(n) is given by the ratio between the combinations C365,n (that is all the set of n birthdays) and the permutations with repetition P365,n, noting that the permutations of the same elements are indistinguishable and should be counted only once.




Bernoulli trials

Let S be the sample space of the outcomes of an experiment and Eqn000.gif two events such that Eqn200.gif.

If e is an outcome of the experiment, what is the probability that, in n repetitions of the same experiment, Eqn204.gif k times?

We assume that the outcomes of the experiments are independent of each other and, for simplicity, we let Eqn202.gif so we can write Eqn203.gif.
q is said the opposite probability with respect to p.

The probability that Eqn204.gif in k experiments and that Eqn205.gif in the remaining n-k experiments is Eqn206.gif.

Since this combination can have Eqn207.gif permutations, the requested probability is






Bayes' theorem

Let S be the sample space of an experiment and Ek (k from 1 to n) events of S such that


Given any event E of S, we have



From the equality (2.4) we get


and from the equality (2.5)


The equality (2.12) is one way to express the Bayes' theorem.


In a school there are 600 girls and 400 boys. 40% of girls and 30% of kids have good grades in math. What is the probability that a student of that school has good grades in math?

Let be p(E) the requested probability, p(E1) the probability that a student is a girl, p(E2) the probability that a student is a boy, p(E|E1) the probability that a girls has good grades in math and p(E|E2) the same probability for a boy.


From (2.12) we get


More elementary:


From the equality (2.8) we get


If, in this equality, we let


we get



and finally


The equality (2.13) is another way to express the Bayes' theorem.

In the previous example, what is the probability that a student with good grades is a girl?

From the equality (2.13) we get


More elementary: