## Basics of probability

### Basics of probability

A probability is a number that reflects the chance or likelihood that a particular event will occur. Probabilities can be expressed as proportions that range from 0 to 1. A probability of 0 indicates that there is no chance that a particular event will occur, whereas a probability of 1 indicates that an event is certain to occur.

### Probability of an Event:

$$P(A) = \frac {n(E)}{n(S)}$$

Where,

n(E) = Number of favorable outcomes

n(S) = Total number of possible outcomes

### Example:

Probability of obtaining an odd number on rolling dice for once.

### Solution:

Sample Space = {1, 2, 3, 4, 5, 6}

n(S) = 6

Favorable outcomes = {1, 3, 5}

n(E) = 3

Using the probability formula,

$$P(A) = \frac {n(E)}{n(S)}$$
$$\text{P(Getting an odd number)} = \frac 36$$
$$= \frac 12 = 0.5$$

### Probability Range:

$$0 \le P(A) \le 1$$

### Rule of Complementary Events:

$$P(A’) = 1- P(A)$$

### Example:

Find the probability that a leap year has 52 Sundays.

### Solution:

A leap year can have 52 Sundays or 53 Sundays.

In a leap year, there are 366 days out of which there are 52 complete weeks & remaining 2 days.

Now, these two days can be (Sat, Sun), (Sun, Mon), (Mon, Tue), (Tue, Wed), (Wed, Thu), (Thu, Fri), (Fri, Sat).

So there are total 7 cases out of which (Sat, Sun) (Sun, Mon) are two favourable cases.

So, P (53 Sundays) $$= \frac 27$$

So, P (52 Sundays) = 1 – P(53 Sundays)

$$= 1 – \frac 27$$

$$= \frac 57$$

$$P(A\cup B) = P(A) + P(B) – P(A\cap B)$$

### Disjoint Events

Events A and B are disjoint if

$$P(A\cap B) = 0$$

### Independent Events:

$$P(A) = P(A|B)$$
$$P(B) = P(B|A)$$
$$P(A\cup B) = P(A) + P(B)$$
$$P(A\cap B) = P(A) \cdot P(B)$$

### Example:

A single fair die is rolled. Let A={3} and B={1,3,5} Are A and B independent?

### Solution:

In this example we can compute all three probabilities

$$P(A)= \frac 16$$

$$P(B)= \frac 12$$

$$P(A\cap B)=P({3})= \frac 16$$

$$P(A)\cdot P(B)=(\frac 16)(\frac 12)=\frac {1}{12}$$

$$P(A\cap B) \neq P(A) \cdot P(B)$$

So,the events A and B are not independent

### Conditional Probability:

$$P(A | B) = P(A\cap B) / P(B)$$

### Bayes Formula:

$$P(A | B) = \frac {P(B | A) \cdot P(A)}{P(B)}$$