## Probability for machine learning and data science – Basic Probability 3 of 6

In this post we will look at Counting. This post is organised as follows

1. Basic rule of counting
2. Permutations
3. Combinations

### Basic rule of counting

Take k tasks such that task I has n_i ways of doing it, then the total number of ways of doing k tasks is

n_1 \times n_2 \times n_3 \times .... \times n_4

We will see this by using an example

Lets take my favourite biryani restaurant which sells the following

• 3 types of biryani
• 15 types of gravies
• 3 types of desserts

Now that I like biryani I need to choose 1 biryani, 1 gravy and 1 dessert. In how many ways can I do it?

let us break the problem in notation and do it. First we need to determine the k value

The k value for the problem is 3

k = 3

n_1 = 3, n_2 = 15, n_3 = 3

So when using the formula above we have

3 \times 15 \times 3 = 135

So i can choose between 135 possible ways of my food.

Before we wrote

n_1 \times n_2 \times n_3 \times …. \times n_4

we can write this in product notation like this

\prod\limits_{i=1}^{k}n_i

### Permutations

A permutation is defined as the number of ways of ordering n distant objects taken r at a time

^n p_r = n(n-1)(n-2)...(n-r+1)

Factorials

Lets us revise what a factorial is

the notation n! called n factorial is defined as

n! = n(n-1)(n-2)... 2 \times 1

Factorial in product notation

\prod\limits_{i=0}^{n-1}(n-i)

Lets write the permutation formula again

^n p_r = n(n-1)(n-2)...(n-r+1) = \frac{n!}{(n-r)!}

### Combinations

The combination is dealing with when we take objects in which order does not matter.

Combinations can be calculated by using

\binom{n}{r} = \frac{n!}{r!(n-r)!}

You can read more about Counting, Permutations and Combinations from this book.

The topics covered in my posts are from this book.

Happy Learning

This post is made possible using LaTeX

## Probability for machine learning and data science – Basic Probability 2 of 6

### Probability Axioms

In this post we will look into probability axioms there are 3 basic axioms of probability and it is mentioned below

Axiom 1 : For any set A

P(A) \geq 0

Axiom 2 :

P (\Omega) = 1

Axiom 3 : if A_1, A_2, ... is any set of disjoint events, then

P\left(\bigcup\limits_{i=1}^{\infty}A_i\right) = \sum\limits_{i=1}^{\infty}P(A_i)

Definition

if A = \bigcup\limits_{i=1}^{\infty} A_i,. and A_1, A_2, .... are disjoint, then A_1, A_2, .... is said to be a partition of A

Axiom 3 also holds for finite collection of events A_1,..., A_n which is trivially true if you set A_{n+1} = \emptyset for all i \in \N

By using the above axioms we can get more axioms. Below are the results from axioms

Compliments

P(A^c) = 1-P(A)

Differences

if A is contained in B ( A \subset B), then

P(B \cap A^c) = P(B) - P(A)

Inclusion – Exclusion

P(A \cup B) = P(A) + P(B) - P(A \cap B)

### Equally likely outcomes

In some cases, we can safely assume the outcomes are equally likely like if we roll a fair dice or toss a fair coin twice or more.

Suppose

• n_A is the number of sample points in event A
• N is the number of sample points in a finite sample space \Omega

if all outcomes are equally likely in a sample space \Omega, then the probability that event A occurs is

P(A)=\frac{n_A}{N},
• n_A is the number of sample points in A
• N is the number of sample points in \Omega

So in this post we have seen the Axioms of probability and in the next post we will start with Counting

Happy Learning

This post was made possible by LaTeX

## Probability for Machine learning and Data Science – Basic Probability Part 1 of 6

In this post, we will explore the basics of probability. As you have learned in school the set notations. we will explore all the symbols that are used to represent the sets. The contents of this post are

1. Sample Space
2. An Event
3. Set Notations

### Sample Space

A sample space is defined as the set of all possible outcomes of a random experiment and it is denoted by \Omega.

Examples of sample spaces

1. The annual rate for rainfall in TamilNadu could take any non-negative value.
2. The number of cars passing at a given point on the national highway in one hour(This will take any non-negative integer).
3. The outcome of tossing 2 different coins.

Let us see the notation of each of the following

The annual rate for rainfall in TamilNadu could take any non-negative value.

\Omega = \{x|x \geq 0, x \in \R\}

The number of cars passing at a given point on the national highway in one hour(This will take any non negative integer).

\Omega = \{x|x = 0,1,2,3,...\}

The outcome of tossing 2 different coins

\Omega = \{HH, HT, TH, TT\}

### Events

Events are denoted by A or B and it is a combination of outcomes and it is a subset of sample space \Omega

Examples of Events include

1. Rainfall less than 700mm in a year
2. Three cars passing a given point

If we see these in notations

Rainfall less than 700mm in a year

A = \{x|0 \leq x \leq 700\}

Three cars passing a given point

B = \{3\}

C = \{HH\}

### Set Notations

Below are the commonly used set notations

Universial set : \Omega

Empty Set : \emptyset

Subset : A \subset B

Union : A \cup B

Intersection : A \cap B

Complement : A^c

Disjoint : A \cap B = \emptyset

We will see Probability Axioms in the next post

Happy Learning

This post is made possible by WordPress and LaTeX