Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Random Variables and Probability Distributions | Section
Exploring Probability Theory
Секція 1. Розділ 8
single

single

bookRandom Variables and Probability Distributions

Свайпніть щоб показати меню

A random variable is a function that assigns a numerical value to each outcome of a random experiment. Random variables are classified as either discrete or continuous.

A discrete random variable can take on a finite or countably infinite set of possible values. For instance, the number of heads when flipping three coins is a discrete random variable, as its possible values are 0, 1, 2, or 3.

A continuous random variable can take on any value within a given interval or collection of intervals. For example, the exact height of a randomly selected person is a continuous random variable, as it can be any real number within a certain range.

The probability mass function (PMF) describes the probability that a discrete random variable is exactly equal to some value. For a discrete random variable XX, the PMF is defined as P(X=x)P(X = x). For example, if XX is the roll of a fair six-sided die, the PMF assigns a probability of 1/61/6 to each possible outcome from 1 to 6.

The probability density function (PDF) is used for continuous random variables. It describes the relative likelihood for this random variable to take on a given value. Unlike the PMF, the PDF itself does not give probabilities directly; instead, the probability that the variable falls within a particular interval is given by the area under the curve of the PDF over that interval. For example, the time between bus arrivals might follow an exponential distribution with a specific PDF.

Understanding the distinction between PMF and PDF is crucial for working with different types of random variables and their distributions.

123456789101112131415161718
import matplotlib.pyplot as plt import numpy as np # Simulate a discrete random variable: rolling a fair six-sided die 1000 times np.random.seed(42) n_trials = 1000 outcomes = np.random.choice([1, 2, 3, 4, 5, 6], size=n_trials) # Calculate the PMF (empirical probabilities) values, counts = np.unique(outcomes, return_counts=True) pmf = counts / n_trials # Plot the PMF plt.bar(values, pmf, tick_label=values) plt.xlabel("Die Face") plt.ylabel("Probability") plt.title("Empirical PMF of a Fair Six-Sided Die") plt.show()
copy
question mark

Which statements about random variables, PMF, and PDF are correct?

Виберіть усі правильні відповіді

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 8
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

some-alt