Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Number System and Arithmetic
  • Algebra
  • Set Theory
  • Probability
  • Statistics
  • Geometry
  • Calculus
  • Logarithms
  • Mensuration
  • Matrices
  • Trigonometry
  • Mathematics
Open In App
Next Article:
Random Variables Practice Problems
Next article icon

Continuous Random Variable

Last Updated : 28 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

In statistics and probability theory, a continuous random variable is a type of variable that can take any value within a given range. Unlike discrete random variables, which can only assume specific, separate values (like the number of students in a class), continuous random variables can assume any value within an interval, making them ideal for modelling quantities that vary smoothly without jumps.

This makes them ideal for modelling a wide range of real-world phenomena, such as the height of individuals, the time taken to complete a task, or the amount of rainfall in a particular period. In this article, we will discuss the concept of "Continuous Random Variable" in detail including its examples and properties. We will also discuss how it is different from a discrete random variable.

Table of Content

  • What is a Continuous Random Variable?
    • Examples of Continuous Random Variables
  • Properties of Continuous Random Variables
    • Probability Density Function (PDF)
    • Cumulative Distribution Function (CDF)
    • Moment Generating Function (MGF)
    • Mean and Variance of Continuous Random Variable
  • Common Continuous Random Variables
    • Uniform Distribution
    • Normal Distribution
    • Exponential Distribution
  • Continuous Random Variable vs Discrete Random Variable
  • Conclusion
  • FAQs

What is a Continuous Random Variable?

Continuous random variable is a type of random variable that can take on an infinite number of possible values within a given range. These values are typically real numbers, and the range can be either bounded or unbounded.

Unlike discrete random variables, which have countable outcomes, continuous random variables are associated with measurable and uncountable outcomes.

Examples of Continuous Random Variables

Continuous random variables can take any value within a given range and are commonly used in various fields to model and analyze real-world phenomena. Here are some examples:

  • Height of Individuals: The height of people within a population can vary continuously. Measurements can be as precise as the measurement tool allows, such as 172.3 cm, 172.33 cm, etc.
  • Weight of Objects: The weight of objects, such as fruits, animals, or packages, is another example. For instance, the weight of an apple can be 150.5 grams, 150.55 grams, and so on.
  • Temperature: Temperature can be measured to a high degree of precision, such as 23.1°C, 23.12°C, and so forth. It is a continuous variable because it can take any value within the thermometric scale.
  • Time: The time it takes to complete a task or event, like running a marathon, is a continuous random variable. For instance, a marathon might be completed in 3 hours, 2 minutes, and 47.5 seconds.
  • Distance: The distance between two points can vary continuously. For example, the distance someone runs can be 5.123 kilometers, 5.1234 kilometers, etc.

Properties of Continuous Random Variables

Continuous random variables have several key properties that distinguish them from discrete random variables and are crucial for understanding their behavior and applications.

Probability Density Function (PDF)

A continuous random variable X is described by a probability density function f(x). The PDF f(x) gives the relative likelihood of X taking on a specific value x.

The PDF must satisfy two conditions: f(x) ≥ 0 for all  x: \int_{-\infty}^{\infty} f(x) \, dx = 1

Cumulative Distribution Function (CDF)

The cumulative distribution function F(x) of a continuous random variable X represents the probability that X takes a value less than or equal to x:

F(x) = P(X \leq x) = \int_{-\infty}^{x} f(t) \, dt

The CDF is non-decreasing and continuous, with: \lim_{x \to -\infty} F(x) = 0 \quad \text{and} \quad \lim_{x \to \infty} F(x) = 1.

Moment Generating Function (MGF)

The moment generating function of X, MX(t), is defined as:

M_X(t) = E(e^{tX}) = \int_{-\infty}^{\infty} e^{tx} \, f(x) \, dx

The MGF, if it exists, can be used to find all moments of X.

Characteristic Function

The characteristic function of X, ϕX(t), is the Fourier transform of the PDF:

\phi_X(t) = E(e^{itX}) = \int_{-\infty}^{\infty} e^{itx} \, f(x) \, dx

It uniquely determines the distribution ofX.

Mean and Variance of Continuous Random Variable

Expectation (Mean): The expectation or mean of a continuous random variable X with PDF f(x) is given by:

E(X) = \int_{-\infty}^{\infty} x \, f(x) \, dx

Variance: The variance of X measures the spread of the random variable around the mean and is given by:

\text{Var}(X) = E[(X - E(X))^2] = \int_{-\infty}^{\infty} (x - \mu)^2 \, f(x) \, dx

Where E(X2) is the second moment of X: E(X2) = \int_{-\infty}^{\infty} x^2 \, f(x) \, dx

Some other important properties are:

Probability of Intervals

  • The probability that X lies within an interval [a, b] is given by the integral of the PDF over that interval: P(a ≤ X ≤ b) = \int_{a}^{b} f(x) \, dx
  • The probability of X taking any specific value x is zero, i.e., P(X = x) = 0.

Moments

Moments are quantitative measures related to the shape of the distribution. The nth moment about the origin is given by:

E(X^n) = \int_{-\infty}^{\infty} x^n \, f(x) \, dx

The nth central moment (about the mean) is given by: E[(X - \mu)^n] = \int_{-\infty}^{\infty} (x - \mu)^n \, f(x) \, dx

Skewness and Kurtosis

Skewness measures the asymmetry of the probability distribution of a real-valued random variable about its mean:

\text{Skewness} = \frac{E[(X - \mu)^3]}{\sigma^3}

Kurtosis measures the "tailedness" of the probability distribution:

\text{Kurtosis} = \frac{E[(X - \mu)^4]}{\sigma^4}

Common Continuous Random Variables

Some of the common distributions where continuous random variable is used are:

  • Uniform Distribution
  • Normal Distribution
  • Exponential Distribution

Uniform Distribution

A continuous random variable X is uniformly distributed between a and b if its PDF is:

f(x) = \begin{cases} \frac{1}{b - a} & \text{for } a \leq x \leq b \\ 0 & \text{otherwise} \end{cases}

Properties

  • Each value in the interval [a, b] is equally likely.
  • The mean is \frac{a + b}{2}.
  • The variance is \frac{(b - a)^2}{12}.

Normal Distribution

A continuous random variable X is said to follow a normal distribution with mean μ and variance σ2 if its PDF is given by:

f(x) = \frac{1}{\sigma \sqrt{2\pi}} \exp\left( -\frac{(x - \mu)^2}{2\sigma^2} \right)

Properties

  • Symmetrical about the mean μ.
  • The mean, median, and mode are all equal.
  • The distribution is described by the parameters μ (mean) and σ (standard deviation).

Exponential Distribution

A continuous random variable X follows an exponential distribution with rate parameter λ if its PDF is:

f(x) = \begin{cases} \lambda e^{-\lambda x} & \text{for } x \geq 0 \\ 0 & \text{for } x < 0 \end{cases}

Properties

  • Describes the time between events in a Poisson process.
  • The mean is 1/λ.
  • The variance is 1/λ2.

Note: Other then these there are some distributions where continuous random variable is useful are:

  • Gamma Distribution
  • Beta Distribution
  • Chi-Square Distribution
  • Student's t-Distribution

Continuous Random Variable vs Discrete Random Variable

The key differences between continuous and discrete random variables are listed in the following table:

FeatureContinuous Random VariableDiscrete Random Variable
DefinitionCan take any value within a given range.Can take only specific, separate values.
Possible ValuesInfinite within a given interval (e.g., all real numbers between 1 and 2)Finite or countably infinite (e.g., integers like 1, 2, 3,...)
ExamplesHeight, weight, temperature, time, distanceNumber of children, number of cars, results of a dice roll
Probability DistributionDescribed by a Probability Density Function (PDF)Described by a Probability Mass Function (PMF)
Probability CalculationProbabilities are calculated over intervalsProbabilities are calculated for specific values
Probability of Single ValueZero (e.g., P(X = x) = 0Non-zero (e.g., P(X = x) > 0)
Cumulative Distribution FunctionCDF, F(x) = P(X ≤ x), is continuousCDF is a step function
VisualizationRepresented by smooth curves (e.g., PDF graph)Represented by bar graphs
Summation vs. IntegrationUses integration to find probabilities (e.g., ∫abf(x) dx)Uses summation to find probabilities (e.g., ∑k=ab P(X=k))
Expectation (Mean)

E(X) = \int_{-\infty}^{\infty} x f(x) \, dx

E(X) = \sum_{x} x P(X = x)

Variance

\text{Var}(X) = \int_{-\infty}^{\infty} (x - \mu)^2 f(x) \, dx

\text{Var}(X) = \sum_{x} (x - \mu)^2 P(X = x)

ApplicationsUsed in real-world measurements where values can vary continuouslyUsed in counting scenarios and where values are distinct

Conclusion

In summary, continuous random variables are a key concept in statistics and probability theory, essential for modeling and analyzing data that can take on any value within a certain range. Unlike discrete random variables, which have distinct and countable values, continuous random variables are characterized by their ability to assume infinitely many values, making them ideal for representing real-world phenomena such as height, weight, time, and temperature.

Read More,

  • Random Variable
  • Discrete Random Variable
  • Binomial Random Variable
  • Uses of Random Variables in Daily Life
  • Expected Value

Next Article
Random Variables Practice Problems
author
somesh_barthwal
Improve
Article Tags :
  • Engineering Mathematics
  • Mathematics
  • Probability

Similar Reads

  • Random Variable
    Random variable is a fundamental concept in statistics that bridges the gap between theoretical probability and real-world data. A Random variable in statistics is a function that assigns a real value to an outcome in the sample space of a random experiment. For example: if you roll a die, you can a
    11 min read
  • Discrete Random Variable
    Discrete Random Variables are an essential concept in probability theory and statistics. Discrete Random Variables play a crucial role in modelling real-world phenomena, from the number of customers who visit a store each day to the number of defective items in a production line. Understanding discr
    15 min read
  • Random Variables Practice Problems
    Random variables are fundamental concepts in probability and statistics, playing a crucial role in data analysis and decision-making processes. Understanding random variables is essential for students as it lays the groundwork for advanced topics such as statistical inference, regression analysis an
    8 min read
  • Decision tree using continuous variable in R
    Decision trees are widely used due to their simplicity and effectiveness. They split data into branches to form a tree structure based on decision rules, making them intuitive and easy to interpret. In R, several packages such as rpart and party are available to facilitate decision tree modeling. Th
    5 min read
  • Variable in Programming
    In programming, we often need a named storage location to store the data or values. Using variables, we can store the data in our program and access it afterward. In this article, we will learn about variables in programming, their types, declarations, initialization, naming conventions, etc. Table
    11 min read
  • Difference Between Discrete and Continuous Variable
    In statistics, variables play a crucial role in understanding and analyzing data. Two fundamental types of variables are discrete and continuous variables. Discrete variables have distinct, separate values with gaps between them, while continuous variables have an unbroken sequence of values. In thi
    5 min read
  • Variable in Maths
    A variable is like a placeholder or a box that can hold different values. In math, it's often represented by a letter, like x or y. The value of a variable can change depending on the situation. For example, if you have the equation y = 2x + 3, the value of y depends on the value of x. So, if you ch
    5 min read
  • Control Variables in Statistics
    Control Variable is a type of variable used to verify the accuracy of any experiment, as the control variable is an essential part of experimental design. Control Variables are used extensively in the field of research where experiments are conducted to compare the new approach to the standard basel
    5 min read
  • Variable Names in MATLAB
    A variable is a named-memory location that stores different types of data which can be used to perform a specific set of operations. It can be thought of as a container that holds some value in memory. The Matlab workspace store all the variables being used during a session. This workspace not only
    5 min read
  • Variables in Research
    In the realm of research, particularly in mathematics and the sciences understanding the concept of the variables is fundamental. The Variables are integral to the formulation of hypotheses the design of the experiments and interpretation of data. They serve as the building blocks for the mathematic
    6 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences