Table of Contents

**Introduction To Sample and Population**

The study of statistics it around the study of data sets. This article describes two important types of data sets – populations and samples. Along the way, we’ll introduce simple random sampling, the main method used when solving a machine learning problem or project.

**Population**

A population includes all of the elements from a set of data. The population is the whole set of values or individuals, you are interested in.

For example, if you want to know the average of the corona virus patient in India, that is your population, i.e. the population of coronavirus patient.

Population characteristic are mean (μ), Standard deviation (σ) , proportion (P) , median, percentiles etc. The value of a population characteristic is fixed. This characteristics are called population distribution. They are symbolized by Greek characters as they are population parameters.

**Sample**

The sample is a subset of the population and is the set of values you actually use in your estimation. Let’s think 1000 individuals you have selected for your study to know about the average of the corona patient of India. This sample has some quantity computed from values e.g. mean (x ), Standard deviation (s), sample proportion, etc. This is called sample distribution. The mean and standard deviation are symbolized by Roman characters as they are sample statistics.

**Population vs Sample**

Population | Sample |

The population is a complete set | A sample is a subset of the population |

The measurably quality is called a parameter. | The sample is a subset of the population. |

It contains all members of specified groups. | It is a subset that represents the entire population. |

**Simple Random Sampling**

A sampling method is a procedure for selecting sample elements from a population. Simple random sampling refers to a sampling method that has the following properties.

There are many ways to obtain a simple random sample. One way would be the lottery method. Each of the *N* population members is assigned a unique number. The numbers are placed in a bowl and thoroughly mixed.

```
Implementation:
# import random
from random import sample
# Prints list of random items of a given length
list1 = [1, 2, 3, 4, 5]
print(sample(list1,3))
Output:
[2, 3, 1]
```

**Conclusion:**

This article is to understand the concepts of sample and population. How to select random sampling from the population.