VOOZH about

URL: https://www.analyticsvidhya.com/blog/2021/04/statistics-and-probability-concepts-for-data-science/

⇱ Statistics and Probability for Data Science | Analytics Vidhya


India's Most Futuristic AI Conference Is Back – Bigger, Sharper, Bolder

  • d
  • :
  • h
  • :
  • m
  • :
  • s

Reading list

Statistics and Probability Concepts for Data Science

Manasvi Last Updated : 14 Oct, 2024
7 min read

Introduction

As far as data science is concerned, basic statistics & probability goes long way. These are two sciences which provide the basis for all data analysis; they allow us to understand, play with and generally utilise some incredibly large pools of information. From understanding patterns to making data-driven decision or building sophisticated machine learning models, there is no other way but the concepts of statistics and probability. In this blog, we will be discussing some very fundamental concepts like Types of data, Mean, Median, Mode,Variability — Variance and Standard deviation plus Probability as well which is considered so much important for any aspirating Data Scientist.

Statistics is the grammar of Science.
– Karl Pearson

This article was published as a part of the Data Science Blogathon.

What is Data?

👁 Statistics and Probability data | what is data in statistics

Image Credits

Data is the information collected through different sources which can be qualitative or quantitative in nature. Mostly, the data collected is used to analyze and draw insights on a particular topic.

For example:

  1. Cylinder size, mileage, color, etc. for the sale of a car
  2. If the cells in the body are malignant or benign to detect Cancer

Types of Data

👁 Types of Data | what is data in statistics

Numerical Data

Numerical data is the information in numbers i.e. numeric which poses as a quantitative measurement of things.

For example:

  1. Heights and weights of people
  2. Stock Prices

a) Discrete Data

Discrete data is the information that often counts of some event i.e. can only take specific values. These are often integer-based, but not necessarily.

For example:

  1. Number of times a coin was flipped
  2. Shoe sizes of people

b) Continuous Data

Continuous Data is the information that has the possibility of having infinite values i.e. can take any value within a range.

For example:

How many centimeters of rain fell on a given day

Categorical Data

This type of data is qualitative in nature which has no inherent mathematical significance. It is sort of a fixed value under which a unit of observation is assigned or “categorized”.

For example:

  1. Gender
  2. Binary Data (Yes/No)
  3. Attributes of a vehicle like color, mileage, number of doors, etc.

Ordinal Data

This type of data is the combination of numerical and categorical data i.e. categorical data having some mathematical significance.

For example:

Restaurant ratings from 1-5, 1 being the lowest and 5 being the highest

Mean, Median and Mode

Mean

In mathematics and statistics, the mean is the average of the numerical observations which is equal to the sum of the observations divided by the number of observations.

👁 A= frac {1}{n} sum limits_{i=1}^n a_i mean Statistics and Probability

where,

👁 A
=arithmetic mean
👁 n
=number of values
👁 a_i
=data set values

Median

The median of the data, when arranged in ascending or descending value is the middle observation of the data i.e. the point separating the higher half to the lower half of the data.

To calculate the median:

  • Arrange the data in ascending or descending order.
  • an odd number of data points: the middle value is the median.
  • even number of data points: the average of the two middle values is the median.
👁 median Statistics and Probability
👁 X
=an ordered list of values in the data set
👁 n
=number of values in data set

Mode

The mode of a set of data points is the most frequently occurring value.

For example:

5,2,6,5,1,1,2,5,3,8,5,9,5 are the set of data points. Here 5 is the mode because it’s occurring most frequently.

Variance and Standard Deviation

Variance

Mathematically and statistically, variance is defined as the average of the squared differences from the mean. But for understanding, this depicts how spread out the data is in a dataset.

The steps of calculating variance using an example:

Let’s find the variance of (1,4,5,4,8)

  1. i.e. (1 + 4 + 5 + 4 + 8)/5 = 4.4
  2. i.e. (-3.4, -0.4, 0.6, -0.4, 3.6)
  3. i.e. (11.56, 0.16, 0.36, 0.16, 12.96)
  4. i.e. 11.56+0.16+0.36+0.16+12.96/5=5.04

The formula for the same is:

👁 Statistics and Probability variance

Standard Deviation

Standard deviation measures the variation or dispersion of the data points in a dataset. It depicts the closeness of the data point to the mean and is calculated as the square root of the variance.

In data science, the standard deviation is usually used to identify the outliers in a data set. The data points which lie one standard deviation away from the mean are considered to be unusual.

The formula for standard deviation is:

👁 Statistics and Probability standard deviation | what is data in statistics
👁 sigma
=population standard deviation
👁 N
=the size of the population
👁 x_i
=each value from the population
👁 mu
=the population mean

Population Data V/s Sample Data

Population data refers to the complete data set whereas sample data refers to a part of the population data which is used for analysis. Sampling is done to make analysis easier.

When using sample data for analysis, the formula of variance is slightly different. If there are total n samples we divide by n-1 instead of n:

👁 Statistics and Probability population data
👁 S^2
=sample variance
👁 x_i
=the value of the one observation
👁 bar{x}
=the mean value of observations
👁 n
=the number of observations

Probability

Image Credits

What is Probability?

The concept of probability is extremely simple. It means how likely an event is about to occur or the chance of the occurrence of an event.

The  formula for probability is:

👁 Probability Formulas- List of Basic Probability Formulas With Examples

👁 Image
For example:

The probability of the coin showing heads when it’s flipped is 0.5.

Conditional Probability

Conditional probability is the probability of an event occurring provided another event has already occurred.

The formula of conditional probability:

👁 Conditional probability using two-way tables (article) | Khan Academy

For example:

The students of a class have given two tests of the subject mathematics. In the first test, 60% of the students pass while only 40% of the students passed both the tests. What percentage of students who passed the first test, cleared the second test?

👁 conditional probability example | what is data in statistics

Bayes’ Theorem

Bayes’ Theorem is a very important statistical concept used in many industries such as healthcare and finance. The formula of conditional probability which we have done above has also been derived from this theorem.

It is used to calculate the probability of a hypothesis based on the probabilities of various data provided in the hypothesis.

The formula for Bayes’ theorem is:

👁 bayes theorem
👁 A, B
=events
👁 P(A|B)
=probability of A given B is true
👁 P(B|A)
=probability of B given A is true
👁 P(A), P(B)
=the independent probabilities of A and B

For example:

Let’s assume there is an HIV test that can identify HIV+ positive patients accurately 99% of the time, and also accurately has a negative result for 99% of HIV negative people. Here, only 0.3% of the overall population is HIV positive.

Conclusion

The topics of statistics and probability covered in the article are really important but there are many other topics such as Probability Distribution Functions and their types, Covariance, and Correlation, etc. that have not been covered here because they require separate attention due to their graphical nature.

Mathematics and statistics are the heart of data science. The topics covered in this article are the basis of many algorithms, error calculating formulas, and graphical understanding of things, thus are very important and cannot be ignored.

Login to continue reading and enjoy expert-curated content.

Free Courses

Generative AI - A Way of Life

Explore Generative AI for beginners: create text and images, use top AI tools, learn practical skills, and ethics.

Getting Started with Large Language Models

Master Large Language Models (LLMs) with this course, offering clear guidance in NLP and model training made simple.

Building LLM Applications using Prompt Engineering

This free course guides you on building LLM apps, mastering prompt engineering, and developing chatbots with enterprise data.

Improving Real World RAG Systems: Key Challenges & Practical Solutions

Explore practical solutions, advanced retrieval strategies, and agentic RAG systems to improve context, relevance, and accuracy in AI-driven applications.

Microsoft Excel: Formulas & Functions

Master MS Excel for data analysis with key formulas, functions, and LookUp tools in this comprehensive course.

Responses From Readers

Ritu Malhotra

All the best Manasvi

Suchitra

A very well drafted analysis.

Brig RS Kochhar

The concepts have been explained in a simplified manner and one can understand the basics from the paper. Well written.

Flagship Programs

GenAI Pinnacle Program| GenAI Pinnacle Plus Program| AI/ML BlackBelt Program| Agentic AI Pioneer Program

Free Courses

Generative AI| DeepSeek| OpenAI Agent SDK| LLM Applications using Prompt Engineering| DeepSeek from Scratch| Stability.AI| SSM & MAMBA| RAG Systems using LlamaIndex| Building LLMs for Code| Python| Microsoft Excel| Machine Learning| Deep Learning| Mastering Multimodal RAG| Introduction to Transformer Model| Bagging & Boosting| Loan Prediction| Time Series Forecasting| Tableau| Business Analytics| Vibe Coding in Windsurf| Model Deployment using FastAPI| Building Data Analyst AI Agent| Getting started with OpenAI o3-mini| Introduction to Transformers and Attention Mechanisms

Popular Categories

AI Agents| Generative AI| Prompt Engineering| Generative AI Application| News| Technical Guides| AI Tools| Interview Preparation| Research Papers| Success Stories| Quiz| Use Cases| Listicles

Generative AI Tools and Techniques

GANs| VAEs| Transformers| StyleGAN| Pix2Pix| Autoencoders| GPT| BERT| Word2Vec| LSTM| Attention Mechanisms| Diffusion Models| LLMs| SLMs| Encoder Decoder Models| Prompt Engineering| LangChain| LlamaIndex| RAG| Fine-tuning| LangChain AI Agent| Multimodal Models| RNNs| DCGAN| ProGAN| Text-to-Image Models| DDPM| Document Question Answering| Imagen| T5 (Text-to-Text Transfer Transformer)| Seq2seq Models| WaveNet| Attention Is All You Need (Transformer Architecture) | WindSurf| Cursor

Popular GenAI Models

Llama 4| Llama 3.1| GPT 4.5| GPT 4.1| GPT 4o| o3-mini| Sora| DeepSeek R1| DeepSeek V3| Janus Pro| Veo 2| Gemini 2.5 Pro| Gemini 2.0| Gemma 3| Claude Sonnet 3.7| Claude 3.5 Sonnet| Phi 4| Phi 3.5| Mistral Small 3.1| Mistral NeMo| Mistral-7b| Bedrock| Vertex AI| Qwen QwQ 32B| Qwen 2| Qwen 2.5 VL| Qwen Chat| Grok 3

AI Development Frameworks

n8n| LangChain| Agent SDK| A2A by Google| SmolAgents| LangGraph| CrewAI| Agno| LangFlow| AutoGen| LlamaIndex| Swarm| AutoGPT

Data Science Tools and Techniques

Python| R| SQL| Jupyter Notebooks| TensorFlow| Scikit-learn| PyTorch| Tableau| Apache Spark| Matplotlib| Seaborn| Pandas| Hadoop| Docker| Git| Keras| Apache Kafka| AWS| NLP| Random Forest| Computer Vision| Data Visualization| Data Exploration| Big Data| Common Machine Learning Algorithms| Machine Learning| Google Data Science Agent
👁 Av Logo White

Continue your learning for FREE

Forgot your password?
👁 Av Logo White

Enter OTP sent to

Edit

Wrong OTP.

Enter the OTP

Resend OTP

Resend OTP in 45s

👁 Popup Banner
👁 AI Popup Banner